A compilation of Dockerfiles for personal use with automated builds enabled on Docker Hub. The images are made with machine learning on GPUs in mind. CUDA enabled images use the NVIDIA CUDA base image at NVIDIA Docker.
The Dockerfiles and associated images for aleksaro/python2-base
,
aleksaro/python3-theano
, aleksaro/python3-tf
,
aleksaro/python3-theano-tf
, aleksaro/python3-nn
,
aleksaro/python3-ml
, and aleksaro/python3-base
have been deprecated in
favour of aleksaro/data-science
.
Before doing anything, make sure that you have Docker Engine and NVIDIA Docker installed. Read more about Docker on the official Docker Docs.
With the automated builds enabled the simplest way to make use of these images
is to run the docker run --runtime=nvidia ...
command. Running one of
the images from Docker Hub and opening a terminal can be achieved by performing
the following command:
docker run --runtime=nvidia -it aleksaro/<image name[:tag]>
When running multiple GPUs it might be useful to isolate the GPUs you want by
using the environment variable NVIDIA_VISIBLE_DEVICES
. For example:
docker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 -it aleksaro/<image name[:tag]>
More information about this and more can be found on the NVIDIA Docker wiki.
The Dockerfiles can, of course, also be built locally using the docker build
command, e.g.:
docker build -t <name[:tag]> -f <Name of Dockerfile> PATH
Shared volumes can be used to read and write data from the host machine within a docker container. For example, three common use cases for machine learning include reading datasets, reading code, and writing trained model parameters.
Volumes are bound to the docker container using the -v
option when running
a Docker image. Read more about how to use shared volumes on the Docker Docs.
The Dockerfiles in this repository can be run by issuing docker run
commands
as stated above, however, we recommend trying out Docker Compose for an easy
way to set up containers.
Information on how to set up the data science Dockerfiles in this repository with Docker Compose can be found at aleksaro/user-dockerfiles.
The main inspiration for these Dockerfiles is Kaixhin. Please have a look at their GitHub page for a slew of general Dockerfiles.
Part of the code is borrowed from Jupyter dockerstacks (see
/base-notebook
). A copy of the relevant license can be found in the
/3rd-part-licenses
directory.