Custom tensorflow GPU container with additional libraries installed for development
206
To create a new image with tensorflow-gpu and install other libraries over it, run the following DockerFile while in the root directory of the project.
docker build -t humbled/tensorflow .
FROM tensorflow/tensorflow:2.0.1-gpu-py3-jupyter
# ADD <yourfiles> /tf # The files you want to permanently include in the image
WORKDIR /tf
RUN apt-get update
RUN apt-get install -y vim wget tmux
# Installing nodejs required for jupyterlab plugins
RUN wget https://deb.nodesource.com/setup_11.x
RUN chmod +x setup_11.x
RUN bash setup_11.x
RUN apt-get install -y nodejs
# Pip upgrade
RUN pip install --upgrade pip
# Installing required packages (some are already present in tensorflow distribution)
RUN pip install --upgrade request scikit-image scikit-learn seaborn tensorflow-probability jupyterlab ipywidgets jupyter-tensorboard
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager
# Installing tensorboard for jupyterlab
# RUN pip install --upgrade jupyter-tensorboard
# RUN jupyter labextension install jupyterlab_tensorboard
# This is to fix a bug in tensorflow docker not finding nvidia drivers:
RUN ldconfig
CMD bash
The following command will create a new container keeping ~/Projects/data_science/ as a volume inside the container with a path address of /tf/notebooks/
nvidia-docker run -it --rm --name tf -v ~/Projects/data_science/:/tf/notebooks/ -p 8888:8888 -p 6006:6006 humbled/tensorflow
As this command gets used a lot, aliasing this is a smart move
alias tensorflow='nvidia-docker run -it --rm --name tf -v ~/Projects/data_science/:/tf/notebooks/ -p 8888:8888 -p 6006:6006 humbled/tensorflow'
While inside the interactive shell of the container the following command with start a jupyter lab server.
jupyter lab --ip=0.0.0.0 --allow-root
Content type
Image
Digest
Size
2.1 GB
Last updated
over 6 years ago
docker pull humbled/tensorflow