Skip to content

PokersKun/dockerdl

 
 

Repository files navigation

DockerDL Docker Build Docker Pulls

Deep Learning Docker Image

Don't waste time on setting up a deep learning env while you can get a deep learning environment with everything pre-installed. This image uses mamba1 to create an environment named DL and then install most of the packages using pip.

List of Packages installed

Image variants and tags

Variant Tag Conda PyTorch TensorFlow Image size
Conda conda ✔️ ✔️ ✔️ Docker Image Size (tag)
No Conda no-conda ✔️ ✔️ Docker Image Size (tag)
PyTorch pytorch ✔️ Docker Image Size (tag)
Tensorflow tensorflow ✔️ Docker Image Size (tag)

You can see the full list of tags https://hub.docker.com/r/matifali/dockerdl/tags.

Requirements

  1. Docker
  2. nvidia-container-toolkit 2
  3. Linux, MacOS, or WSL2

Fast Start

docker run --gpus all --rm -it -h dockerdl matifali/dockerdl:no-conda bash

Optionally launch a Jupyter notebook server

docker run --gpus all --rm -it -h dockerdl -p 8888:8888 matifali/dockerdl:conda
jupyter notebook --no-browser --port 8888 --NotebookApp.token='' --ip='*'

Or a JupyterLab server without conda

docker run --gpus all --rm -it -h dockerdl -p 8888:8888 matifali/dockerdl:noconda
jupyter lab --no-browser --port 8888 --ServerApp.token='' --ip='*'

Connect by opening http://localhost:8888 in your browser.

Build your own

Clone the repo

git clone https://github.com/matifali/dockerdl.git

Add or delete packages

Modify Dockerfile to add or delete packages.

Build

Following --build-arg are available:

Argument Description Default Possible Values
USERNAME User name coder Any string or $USER
USERID User ID 1000 $(id -u $USER)
GROUPID Group ID 1000 $(id -g $USER)
PYTHON_VER Python version 3.10 3.10, 3.9, 3.8
CUDA_VER CUDA version 11.7 11.7, 11.5, 11.4
UBUNTU_VER Ubuntu version 22.04 22.04, 20.04, 18.04
TF_VERSION TensorFlow version latest any version from Pypi3

Note: Not all combinations of --build-arg are tested.

Example 1

Build an image with default settings and your own username and user id

docker build -t dockerdl:latest /
--build-arg USERNAME=$USER /
--build-arg USERID=$(id -u $USER) /
--build-arg GROUPID=$(id -g $USER) /
-f conda.Dockerfile .

Example 2

Build an image with Python 3.9, TensorFlow 2.6.0, CUDA 11.5, Ubuntu 20.04 and without conda

docker build -t dockerdl:latest /
--build-arg USERNAME=$USER /
--build-arg USERID=$(id -u $USER) /
--build-arg GROUPID=$(id -g $USER) /
--build-arg PYTHON_VER=3.9 /
--build-arg CUDA_VER=11.5 /
--build-arg UBUNTU_VER=20.04 /
--build-arg TF_VERSION=2.6.0 /
-f noconda.Dockerfile .

Run

docker run --gpus all --rm -it -h dockerdl dockerdl:latest bash

How to connect

Jetbrains PyCharm Professional

Follow the instructions here.

VS Code

  1. install vscode
  2. Install Docker extension
  3. Install Python extension
  4. install Remote Development extension
  5. Follow the instructions here.

Issues

If you find any issue please feel free to create an issue and submit a PR.

Support

  • Please give a star (⭐) if using this has helped you.
  • Help the flood victims in Pakistan by donating here

Footnotes

  1. mamba is a fast, drop-in replacement for the conda package manager. It is written in C++ and uses the same package format as conda. It is designed to be a drop-in replacement for conda, and can be used as a drop-in replacement for the conda command line client.

  2. This image is based on nvidia/cuda and uses nvidia-container-toolkit to access the GPU.

  3. PyPI is the Python Package Index. It is a repository of software for the Python programming language.

About

Deep Learning Docker Image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%