docker-gpu-setup

Build GPU-enabled Docker containers with NGC base images and uv.

17|3|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/jayll1303/AIEKit --skill docker-gpu-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-gpu-setup
Source: https://github.com/jayll1303/AIEKit/tree/main/.kiro/skills/docker-gpu-setup
Command: npx skills add https://github.com/jayll1303/AIEKit --skill docker-gpu-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building and running GPU-enabled Docker containers for ML workloads is error-prone and slow without standard patterns, resulting in broken GPU passthrough, huge unreproducible images, and long rebuild times. This Skill provides clear, production-ready Dockerfile patterns, Compose snippets, and troubleshooting steps to ensure containers see GPUs, dependencies are cached, and images remain reproducible.

Core Features & Use Cases

  • Multi-stage Dockerfile templates for isolating dependency installs and producing slim runtime images.
  • NGC base image guidance to choose the right nvcr.io image for training, inference, dev, or runtime scenarios.
  • uv-in-Docker and BuildKit cache patterns to speed dependency installs and enable reproducible builds.
  • docker-compose GPU passthrough snippets and verification steps for Compose v2 deployments.
  • GPU troubleshooting checklist covering NVIDIA driver, NVIDIA Container Toolkit, docker runtime config, driver/CUDA compatibility, and common runtime errors.
  • Use Case: Build a multi-stage PyTorch training image that installs dependencies via uv, caches builds with BuildKit, runs with GPU passthrough, and verifies GPU visibility with nvidia-smi.

Quick Start

Create a multi-stage Dockerfile using an appropriate NGC base, copy the uv binary from the official image, build with BuildKit enabled, run the container with GPU passthrough, and verify GPU access by running nvidia-smi inside the container.

Frequently Asked Questions about docker-gpu-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable GPU passthrough in Docker Compose for CUDA workloads?

To enable GPU passthrough in Docker Compose, configure the runtime and GPU device access in your Compose v2 file. This Skill provides ready-to-use snippets and verification steps to confirm the container sees the GPU correctly.

What is the best way to build slim GPU Docker images for machine learning?

The best way to build slim GPU Docker images is using multi-stage Dockerfile templates with NGC base images. This isolates dependency installs and produces a slim runtime image, ensuring reproducible ML builds.

Do I need NVIDIA Container Toolkit to run CUDA workloads in Docker?

Yes, you need the NVIDIA Container Toolkit and a working host NVIDIA driver to run CUDA workloads in Docker. This Skill includes a troubleshooting checklist for verifying runtime config and driver compatibility.

How do I cache dependencies during a Docker build for PyTorch training?

To cache dependencies during a Docker build, use BuildKit cache mounts alongside uv-based dependency installs. This Skill demonstrates how to copy the uv binary and apply BuildKit patterns to speed up builds.

Why does nvidia-smi fail inside my GPU Docker container?

nvidia-smi fails inside a GPU Docker container due to missing NVIDIA Container Toolkit configuration or host driver mismatch. This Skill provides a troubleshooting checklist covering driver compatibility and runtime errors.

How do I choose the right NGC base image for my ML training container?

To choose the right NGC base image, match the nvcr.io image with your host driver and CUDA versions. This Skill provides NGC guidance for selecting appropriate training, inference, or runtime scenarios.