For all of you struggling with this as well. I solved it by building my own container and adding some flags when running the container.
An example, adding Keras to the nvidia tensorflow container.
- Create a file called "Dockerfile"
- Enter the following
FROM nvcr.io/nvidia/tensorflow:18.08-py3 WORKDIR /my-ml-files RUN pip install jupyter EXPOSE 8888 RUN pip install keras
- Run the following in a terminal inside of the folder where you saved the "Dockerfile"
docker build -t my-nvidia-container .
- The container is now built. To run it run the following
docker run --runtime=nvidia -it my-nvidia-container
If you’re looking to add a folder with files to the docker container
Run the following command when starting the docker container instead
docker run --runtime=nvidia -it -v "/my-local-computer-files/:/my-docker-container/" my-nvidia-container
. Where if you change directory to
/my-docker-container/
inside of the container, your files in
/my-local-computer-files/
should be visible and accessible.
Access jupyter notebook
Add the flag
-p 8888:8888
to the command. You may combine this with the one above (
-v "/my-local-computer-files/:/my-docker-container/"
).
Example:
docker run --runtime=nvidia -it -p "8888:8888" -v "/my-local-computer-files/:/my-docker-container/" my-nvidia-container
And when you’re inside of the docker container run
jupyter notebook --port=8888 --ip=0.0.0.0 --allow-root --no-browser .
and then you’ll be able to access it from your local browser at http://localhost:8888
Hope that helps.
Victor