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-nvidiaFor standard Docker operations without GPU support:
docker run -it --rm --privileged ghcr.io/prasad89/dind-ubuntu-nvidiaTo utilize NVIDIA GPU support within the Docker environment:
docker run -it --rm --privileged --gpus all ghcr.io/prasad89/dind-ubuntu-nvidiaReplace --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.ymlThis repository includes a Makefile to simplify building, running, pulling, and pushing the Docker image. Below are the available commands:
make buildBy 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_standardmake run_gpumake pullmake pushmake build_run_standardmake build_run_gpumake build_pushmake k8s_deployIf 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).