Skip to content

Instantly share code, notes, and snippets.

@rcgalbo
Created March 9, 2018 18:44
Show Gist options
  • Save rcgalbo/5a6ce48b21a889995f00fb3afed19436 to your computer and use it in GitHub Desktop.
Save rcgalbo/5a6ce48b21a889995f00fb3afed19436 to your computer and use it in GitHub Desktop.
fast.ai docker file
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
LABEL com.nvidia.volumes.needed="nvidia_driver"
RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list
RUN apt-get update && apt-get install -y --allow-downgrades --no-install-recommends \
build-essential \
cmake \
git \
curl \
vim \
ca-certificates \
libnccl2=2.0.5-3+cuda9.0 \
libnccl-dev=2.0.5-3+cuda9.0 \
python-qt4 \
libjpeg-dev \
zip \
unzip \
libpng-dev &&\
rm -rf /var/lib/apt/lists/*
ENV PYTHON_VERSION=3.6
RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x ~/miniconda.sh && \
~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda install conda-build
WORKDIR /notebooks
RUN git clone https://github.com/fastai/fastai.git .
RUN ls && /opt/conda/bin/conda env create
RUN /opt/conda/bin/conda clean -ya
ENV PATH /opt/conda/envs/fastai/bin:$PATH
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
ENV USER fastai
CMD source activate fastai
CMD source ~/.bashrc
WORKDIR /data
RUN curl http://files.fast.ai/data/dogscats.zip --output dogscats.zip
RUN unzip -d . dogscats.zip
RUN rm dogscats.zip
RUN ln -s /data/ /notebooks/courses/dl1/
RUN ls -la /notebooks/courses/dl1/data/
RUN chmod -R a+w /notebooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment