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.
- TensorFlow
- PyTorch
- Numpy
- Scikit-Learn
- Pandas
- Matplotlib
- Seaborn
- Plotly
- NLTK
- Jupyter notebook/lab
- conda
- mamba
- pip
Variant | Tag | Conda | PyTorch | TensorFlow | Image size |
---|---|---|---|---|---|
Conda | conda |
✔️ | ✔️ | ✔️ | |
No Conda | no-conda |
❌ | ✔️ | ✔️ | |
PyTorch | pytorch |
❌ | ✔️ | ❌ | |
Tensorflow | tensorflow |
❌ | ❌ | ✔️ |
You can see the full list of tags https://hub.docker.com/r/matifali/dockerdl/tags.
- Docker
- nvidia-container-toolkit 2
- Linux, MacOS, or WSL2
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.
git clone https://github.com/matifali/dockerdl.git
Modify Dockerfile
to add or delete packages.
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.
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 .
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 .
docker run --gpus all --rm -it -h dockerdl dockerdl:latest bash
Follow the instructions here.
- install vscode
- Install Docker extension
- Install Python extension
- install Remote Development extension
- Follow the instructions here.
If you find any issue please feel free to create an issue and submit a PR.
- Please give a star (⭐) if using this has helped you.
- Help the flood victims in Pakistan by donating here
Footnotes
-
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. ↩
-
This image is based on nvidia/cuda and uses nvidia-container-toolkit to access the GPU. ↩
-
PyPI is the Python Package Index. It is a repository of software for the Python programming language. ↩