Skip to content

Commit

Permalink
Merge pull request #58 from sony/feature/20181025-dockerfile
Browse files Browse the repository at this point in the history
[doc][docker] Add Dockerfile beta
  • Loading branch information
YukioOobuchi committed Nov 2, 2018
2 parents 9a2b326 + d34f04d commit e47a321
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
@@ -0,0 +1,26 @@
ARG CUDA_VER=9.0
ARG CUDNN_VER=7

FROM nvidia/cuda:${CUDA_VER}-cudnn${CUDNN_VER}-runtime-ubuntu16.04

ARG PYTHON_VER=3.5
ARG CUDA_VER=9.0
ENV PATH /opt/miniconda3/bin:$PATH
ENV OMP_NUM_THREADS 1

RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
bzip2 \
curl \
&& rm -rf /var/lib/apt/lists/*

RUN umask 0 \
&& wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda3 \
&& rm -rf Miniconda3-latest-Linux-x86_64.sh \
&& conda install -y python=${PYTHON_VER} \
&& (pip install --no-cache-dir -U setuptools || pip install --no-cache-dir -U setuptools || pip install --no-cache-dir -U setuptools || true) \
&& conda install -y opencv jupyter

RUN umask 0 \
&& pip install nnabla-ext-cuda`echo $CUDA_VER | sed 's/\.//g'`
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -9,3 +9,27 @@ Before running an example, also run the following command inside the example dir
cd example_directory
pip install -r requirements.txt
```


## Docker image

If you have [Docker](https://www.docker.com/) and [NVIDIA Docker](https://www.docker.com/) on your system, you can build and run a CUDA-compatible Docker image which contains dependencies for running most of the examples in this repository.

The following command creates the Docker image.

```shell
docker build -t local/nnabla-examples . --build-arg CUDA_VER=9.2 --build-arg CUDNN_VER=7 --build-arg PYTHON_VER=3.6
```

The options followed by `--build-arg` specify the versions of some dependent software. You can ommit these arguments if you use the default. You can find the default versions at the lines containing `ARG` commands in the [Dockerfile](./Dockerfile).


A Docker container of the created image can be launched by;

```shell
nvidia-docker run {options} local/nnabla-examples {command}
```

*Note*:

* You must use a CUDA toolkit version compatible with your CUDA driver version on your host system.

0 comments on commit e47a321

Please sign in to comment.