forked from microsoft/LightGBM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add dockerfile * [deprecated]remove MAINTAINER
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Using LightGBM via Docker | ||
|
||
This directory contains `Dockerfile` to make it easy to build and run LightGBM via [Docker](http://www.docker.com/). | ||
|
||
## Installing Docker | ||
|
||
Follow the general installation instructions | ||
[on the Docker site](https://docs.docker.com/installation/): | ||
|
||
* [OSX](https://docs.docker.com/installation/mac/): [docker toolbox](https://www.docker.com/toolbox) | ||
* [ubuntu](https://docs.docker.com/installation/ubuntulinux/) | ||
|
||
## Running the container | ||
|
||
Build the container, for python users: | ||
|
||
$ docker build -t lightgbm -f dockerfile-python . | ||
|
||
After build finished, run the container: | ||
|
||
$ docker run --rm -it lightgbm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y cmake build-essential gcc g++ git wget && \ | ||
|
||
# open-mpi | ||
cd /usr/local/src && mkdir openmpi && cd openmpi && \ | ||
wget https://www.open-mpi.org/software/ompi/v2.0/downloads/openmpi-2.0.1.tar.gz && \ | ||
tar -xzf openmpi-2.0.1.tar.gz && cd openmpi-2.0.1 && \ | ||
./configure --prefix=/usr/local/openmpi && make && make install && \ | ||
export PATH="/usr/local/openmpi/bin:$PATH" && \ | ||
|
||
# lightgbm | ||
cd /usr/local/src && mkdir lightgbm && cd lightgbm && \ | ||
git clone --recursive https://github.com/Microsoft/LightGBM && \ | ||
cd LightGBM && mkdir build && cd build && cmake -DUSE_MPI=ON .. && make && \ | ||
|
||
# python-package | ||
# miniconda | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | ||
/bin/bash Miniconda3-latest-Linux-x86_64.sh -f -b -p /opt/conda && \ | ||
export PATH="/opt/conda/bin:$PATH" && \ | ||
# lightgbm | ||
conda install -y numpy scipy scikit-learn pandas && \ | ||
cd ../python-package && python setup.py install && \ | ||
|
||
# clean | ||
apt-get autoremove -y && apt-get clean && \ | ||
conda clean -i -l -t -y && \ | ||
rm -rf /usr/local/src/* | ||
|
||
ENV PATH /opt/conda/bin:$PATH |