Home

Awesome

DockerDL Docker Build Docker Pulls <a href='https://hub.docker.com/r/matifali/dockerdl' target="_blank"><img alt='DockerHub' src='https://img.shields.io/badge/DockerHub-100000?logoColor=0000FF&labelColor=0000FF&color=0000FF'/></a>

DALL·E A wide-screen, imaginative illustration of a whale engaged in machine learning activities, featuring a large container to symbolize Docker

Deep Learning Docker Image

Don't waste time on setting up a deep learning environment while you can get a deep learning environment with everything pre-installed.

List of Packages installed

Image variants and tags

VariantTagCondaPyTorchTensorFlowImage size
Condaconda:heavy_check_mark::x::x:Docker Image Size (tag)
Tensorflowtf:x::x::heavy_check_mark:Docker Image Size (tag)
PyTorchtorch:x::heavy_check_mark::x:Docker Image Size (tag)
PyTorch + Tensorflowtf-torch, latest:x::heavy_check_mark::heavy_check_mark:Docker Image Size (tag)
PyTorch + Tensorflow + Condatf-torch-conda:heavy_check_mark::heavy_check_mark::heavy_check_mark: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 1
  3. Linux, or Windows with WSL2

Fast Start

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

JupyterLab server without conda

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

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

Customize the image

Clone the repo

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

Add or delete packages

Modify the corresponding [Dockerfile] to add or delete packages.

[!NOTE] You may have to rebuild the dockerdl-base if you are building a custom image and then use it as a base image. See Build section.

Build

The following --build-arg are available for the dockerdl-base image.

ArgumentDescriptionDefaultPossible Values
USERNAMEUser namecoderAny string or $USER
USERIDUser ID1000$(id -u $USER)
GROUPIDGroup ID1000$(id -g $USER)
CUDA_VERCUDA version12.4.1
UBUNTU_VERUbuntu version22.0422.04, 20.04, 18.04

[!WARNING] Not all combinations of --build-arg are tested.

Step 1

Build the base image

docker build -t dockerdl-base:latest --build-arg USERNAME=coder --build-arg CUDA_VER=12.4.1 --build-arg UBUNTU_VER=22.04 -f base.Dockerfile .

Step 2

Build the image you want with the base image as the base image.

docker build -t dockerdl:tf --build-arg TF_VERSION=2.12.0 -f tf.Dockerfile .

or

docker build -t dockerdl:torch --build-arg -f torch.Dockerfile .

How to connect

VS Code

  1. Install vscode.
  2. Install the following extensions:
    1. Docker.
    2. Python.
    3. Remote Development.
  3. Follow the instructions here.

Coder

  1. Install Coder. (https://github.com/coder/coder).
  2. Use deeplearning template which references these images (https://github.com/matifali/coder-templates/tree/main/deeplearning).

JetBrains PyCharm Professional

Follow the instructions here.

Issues

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

Support

References

Footnotes

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