Base image for machine learning projects using Miniconda and Tensorflow. The idea is you can clone this repo and use it to start a new ML project, just adjust environment.yml
accordingly.
Currently uses: CUDA 10.0 for use with NVIDIA binary driver
You need to have the latest NVIDIA binary driver installed on the host system. Docker will pass privileges to the container so that it can access the video card when needed.
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo ubuntu-drivers autoinstall
You can also see a list of alternative drivers
ubuntu-drivers devices
docker build -t mlbase:cuda10 .
Change to the project code directory. This will be mapped to the /code
directory inside the container.
If this is the first time running you'll need to create and setup the container by running:
docker run -dt --name projectname --runtime=nvidia -e UID=$(id -u) -e GID=$(id -g) -e USER=$(whoami) -e DISPLAY="$DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/code -p 8000:8000 mlbase:cuda10 /bin/bash -l
It can then be started with
docker start projectname
To get a shell in the running container
docker exec -it -u $(whoami) -e DISPLAY="$DISPLAY" projectname /bin/bash -l
At first run, setup the ml
conda environment
sudo /opt/conda/bin/conda env update --file /code/environment.yml
source activate ml
To use, append this to the docker run
command:
"jupyter notebook --ip=0.0.0.0 --port=8888"