This repository offers an Ubuntu-based Docker-in-Docker (DinD) environment tailored for containerized development, enriched with NVIDIA container runtime support. The base image is crafted on Ubuntu 24.10.
- Ubuntu 24.10: Built on the latest stable Ubuntu LTS platform for reliability and long-term support.
- Docker-in-Docker (DinD): Enables nested Docker containerization, ideal for CI/CD pipelines and advanced development workflows.
- NVIDIA Container Runtime: Facilitates execution of GPU-accelerated applications leveraging NVIDIA GPUs for enhanced performance.
To obtain the pre-built Docker image from Docker Hub, execute the following command:
docker pull ghcr.io/prasad89/dind-ubuntu-nvidia
For standard Docker operations without GPU support:
docker run -it --rm --privileged ghcr.io/prasad89/dind-ubuntu-nvidia
To utilize NVIDIA GPU support within the Docker environment:
docker run -it --rm --privileged --gpus all ghcr.io/prasad89/dind-ubuntu-nvidia
Replace --gpus all
with specific GPU settings (--gpus device=0,1
) as per your hardware configuration.
To deploy the container in a Kubernetes cluster:
kubectl apply -f https://raw.githubusercontent.com/prasad89/dind-ubuntu-nvidia/main/k8s-deployement.yml
This repository includes a Makefile to simplify building, running, pulling, and pushing the Docker image. Below are the available commands:
make build
By default, this make
command builds a multiple architecture image using buildx
. Make sure you have a compatible buildx
driver installed to run this.
Optionally, if you don't want to build for multiple architectures, you can simply run: docker build -f Dockerfile -t REGISTRY_PREFIX/IMAGE_NAME:TAG .
make run_standard
make run_gpu
make pull
make push
make build_run_standard
make build_run_gpu
make build_push
make k8s_deploy
If you need to customize the image name, tag, or registry prefix, you can modify the variables in the Makefile:
- IMAGE_NAME: The name of the Docker image (default:
dind-ubuntu-nvidia
). - TAG: The tag for the Docker image (default:
latest
). - REGISTRY_PREFIX: The registry prefix where the image is stored (default:
ghcr.io/prasad89
). - GPU_COUNT: The number of GPUs to use (default:
all
). Adjust this as needed for your specific setup. - PLATFORM: The platforms for which the Docker image is built (default:
linux/amd64,linux/arm64
).