This repository contains a Dockerfile to set up a base development environment tailored for deep learning projects. It includes essential tools such as Python, Poetry, and Miniconda, with CUDA support for GPU-accelerated computation. This setup is optimized for flexibility and efficiency in development.
-
Base Image: The Docker image starts from
nvidia/cuda:12.1.0-devel-ubuntu20.04, which includes the necessary CUDA toolkit for GPU-related tasks. This image does not come with Python pre-installed, so we manually install Python 3.8 to ensure compatibility with the development environment. -
Python Installation: We update the package list and install essential utilities like
wget,curl,git, andpython3, followed bypython3-pipfor managing Python packages. -
Poetry Installation: Poetry is used for Python dependency management and packaging. We install Poetry version 1.8.0 by fetching its installation script and adding its executable to the
PATH. -
Miniconda Installation: To manage environments more efficiently, we install Miniconda, a lightweight version of Anaconda. It allows the creation of isolated environments using
condaand is ideal for deep learning workflows. Miniconda is installed by downloading and running the installer script. -
TINI Installation: To handle proper signal handling for the container, we install TINI, a tiny init system, which ensures that the container shuts down gracefully.
-
Conda Environment Integration with Poetry: We configure Poetry to use a
condaenvironment for virtual environments rather than Poetry’s default virtual environment system. This is achieved by setting theCONDA_ENV_PATHto/opt/conda/envs/and disabling Poetry’s internal virtualenv creation.
- CUDA Toolkit: Enables GPU-accelerated computing for deep learning.
- Python 3.8: Installed for compatibility with deep learning libraries.
- Poetry: For efficient Python package management.
- Miniconda: A lightweight package manager for managing isolated environments.
- TINI: Ensures graceful shutdown of the container.
- Conda Environment Integration: Uses
condaenvironments for virtual environments, managed by Poetry.
-
Clone the repository:
git clone https://github.com/yourusername/deep-learning-base-dev-env.git cd deep-learning-base-dev-env -
Build the Docker image:
docker build -t deep-learning-dev-env . -
Run the Docker container:
docker run -it deep-learning-dev-env bash
-
Verify Poetry Installation:
poetry --version
-
Configure Conda environment (if needed): Poetry is already configured to use
condafor environment management.