A NVIDIA Dockerfile for fastai

Hi all,

I wrote a Dockerfile which works nicely on NVIDIA DGX machines: it may possibly work on other machines with a NVIDIA GPU where Docker is installed, but I didn’t test it. I share it here, in case someone else can find it useful. The image is targeted heavily towards Computer Vision, thus it installs a few Linux/Python libraries which are useful for CV.

FROM nvcr.io/nvidia/pytorch:19.08-py3

# STANDARD LINUX & PYTHON LIBRARIES FOR CV
RUN apt-get update && apt-get install -y libsm6 libxext6 libxrender-dev libgl1-mesa-glx
RUN pip install opencv-python
RUN pip install numpy pandas scikit-learn scikit-image matplotlib seaborn pillow scipy

# FASTAI
RUN pip install fastai jupyter notebook jupyter_contrib_nbextensions

WORKDIR /

EXPOSE 8888
CMD ["jupyter", "notebook", "--allow-root", "--ip=0.0.0.0"]
2 Likes