Docker
Docker packages software and its runtime dependencies into container images and runs them as isolated processes. In AI work, practitioners use it to create repeatable training or serving environments, manage filesystem and network configuration and make the exact application package identifiable across development and deployment.
What it is
An image is a layered package describing the filesystem and execution defaults; a container is a running instance with configured resources, mounts and networking. A Dockerfile defines how the image is built. Containers share the host kernel, distinguishing them from full virtual machines. For AI workloads, model files may be included in the image or supplied separately, and accelerator access depends on host drivers and runtime configuration. Docker therefore standardizes important parts of packaging without making every host equivalent. The image, model artifact and deployment settings together determine the running application.
What the work involves
The practitioner chooses a suitable base image, pins dependencies and builds a minimal package with explicit startup behavior. Large models and data need a deliberate storage strategy rather than accidental duplication in image layers. Useful outputs include the Dockerfile, image digest and deployment configuration. Tests run the actual image with representative inputs, resource limits and expected mounts. Secrets should be supplied through runtime facilities rather than baked into layers, and host-specific GPU requirements need checking separately from ordinary application dependencies.
Illustrative example
A prediction service is packaged with its tokenizer and preprocessing code, while the versioned model weights are mounted read-only at startup. The container exposes a health check that confirms successful model loading. A staging test uses the release image digest, verifies missing-model failure and checks a sample prediction. The same image is promoted to production with explicit accelerator and memory settings, making differences in deployment configuration visible.
Limits and common mistakes
An image tag can move, and a repeatable package can still produce different results across hardware or drivers. Containers do not provide every isolation guarantee of a virtual machine. Oversized images increase transfer and startup time, especially for scaling inference services. Quality requires identifiable builds, controlled mounts and tested runtime behavior. Docker supports reproducible environments, but data versions, model artifacts, hardware and nondeterministic computation still need separate management for reproducible AI results.
Prerequisites
- mediumShell Scripting
Dockerfiles use shell commands; debugging containers often requires shell literacy
Related skills
- → is an instance of: Containerization
Sources and further reading
- Docker overview
Defines images, containers, build files, registries and the container execution model.
Last updated: 2026-10-10