DockerDL [](https://github.com/matifali/dockerdl/actions/workflows/docker-publish.yml)

September 13, 2026 · View on GitHub

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

VariantTagPyTorchTensorFlowImage size
Tensorflowtf:x::heavy_check_mark:Docker Image Size (tag)
PyTorchtorch:heavy_check_mark::x:Docker Image Size (tag)
PyTorch + Tensorflowtf-torch, latest:heavy_check_mark::heavy_check_mark:Docker Image Size (tag)

All images use a uv-managed Python 3.13 in /opt/venv on Ubuntu 26.04. CUDA 12.6 and cuDNN come from the PyTorch and TensorFlow pip wheels, so the only host requirement is an NVIDIA driver that supports CUDA 12 (>= 525). The conda and tf-torch-conda tags are no longer built; the last conda-based images remain on Docker Hub.

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

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 base image is plain ubuntu; edit the FROM line in base.Dockerfile to change it. The CUDA version is chosen by the pip wheels: PyTorch comes from the cu126 index (torch.Dockerfile, tf-torch.Dockerfile) and TensorFlow's [and-cuda] extra pulls matching CUDA 12 libraries.

Python is installed by uv into /opt/venv (owned by the ubuntu user, so uv pip install <pkg> works without sudo). Pick the version with --build-arg PYTHON_VER=3.13 (default; the newest version TensorFlow ships wheels for).

Step 1

Build the base image

docker build -t dockerdl-base:latest -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 BASE_IMAGE=dockerdl-base:latest --build-arg TF_VERSION=2.21.0 -f tf.Dockerfile .

or

docker build -t dockerdl:torch --build-arg BASE_IMAGE=dockerdl-base:latest -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

  • Give a star (⭐) if using this has helped you.
  • Sponsor matifali

References

Footnotes

  1. CUDA and cuDNN libraries come from the PyTorch/TensorFlow pip wheels; nvidia-container-toolkit mounts the host driver, nvidia-smi and libnvidia-ml into the container.