Docker is a containerization platform that packages applications with their dependencies into lightweight, portable containers. It revolutionized software deployment by solving the "works on my machine" problem through consistent, isolated environments that run identically across development, testing, and production. Docker containers share the host OS kernel, making them far more efficient than traditional virtual machines while maintaining strong isolation. Docker Engine uses BuildKit as its default builder and Docker Compose V2 as the standard for multi-container orchestration. The 2025β2026 release cycle significantly expanded Docker's scope: Docker Model Runner enables local AI inference with an OpenAI-compatible API; Docker Scout provides integrated vulnerability scanning and SBOM analysis; Docker Hardened Images (DHI) offer free, distroless-based images with CVE patches within 24 hours; and Docker Build Cloud offloads builds to remote infrastructure for faster CI. The key mental model: a container is a running instance of an image, where images are immutable blueprints built in layers, and layers are cached for speedβunderstanding this layer caching mechanism is critical for optimizing build times and image sizes.
33 tables, 244 concepts. Select a concept node to jump to its table row.
Table 1: Container Lifecycle Management
| Command | Example | Description |
|---|---|---|
docker run -d -p 8080:80 --name web nginx | β’ Creates and starts a new container from an image β’ -d runs detached, -p maps ports, --name assigns a custom name. Most commonly used command. | |
docker start web | β’ Starts an existing stopped container β’ preserves all container state and configuration. | |
docker stop web | Gracefully stops a running container by sending SIGTERM then SIGKILL after grace period (default 10s). | |
docker restart web | β’ Stops then starts a container β’ equivalent to stop + start. | |
docker pause web | β’ Freezes all processes in a container using cgroups β’ no CPU/memory usage, instant resume with unpause. | |
docker unpause web | β’ Resumes a paused container β’ restores execution exactly where it stopped. | |
docker rm -f web | β’ Removes a stopped container β’ -f forces removal of running containers by killing them first. | |
docker kill web | β’ Immediately stops a container by sending SIGKILL β’ no graceful shutdown, use for unresponsive containers. | |
docker create --name web nginx | β’ Creates a container without starting it β’ useful for preparing containers before start. | |
docker wait web | β’ Blocks until a container stops, then prints its exit code β’ useful in scripts. | |
docker rename web web-old | β’ Renames an existing container β’ works on running and stopped containers. | |
docker update --cpus 2 --memory 1g web | β’ Dynamically updates resource limits and restart policy on running containers β’ avoids container recreation. |
Table 2: Container Inspection and Interaction
| Command | Example | Description |
|---|---|---|
docker ps -a | β’ Lists containers β’ default shows running only, -a includes stopped. | |
docker logs -f --tail 100 web | β’ Shows container stdout/stderr β’ -f follows live output, --tail limits lines. | |
docker exec -it web bash | β’ Runs a new process inside a running container β’ -it allocates interactive TTY for shell access. | |
docker attach web | β’ Connects to container's main process stdin/stdout β’ Ctrl+C stops the container. | |
docker inspect web | Returns detailed JSON with all container metadata including config, state, network, mounts. | |
docker stats web | β’ Live stream of CPU, memory, network, disk I/O metrics β’ press Ctrl+C to stop. | |
docker top web | β’ Shows running processes inside a container β’ equivalent to ps inside the container. | |
docker port web | β’ Lists all port mappings for a container β’ shows host port β container port bindings. | |
docker diff web | Shows filesystem changes (A=added, C=changed, D=deleted) since container creation. |
Table 3: Image Management
| Command | Example | Description |
|---|---|---|
docker build -t myapp:1.0 . | β’ Builds an image from a Dockerfile β’ -t tags it, . specifies build context directory. | |
docker images | Lists all local images with repository, tag, image ID, creation date, and size. | |
docker pull nginx:alpine | β’ Downloads an image from a registry (default Docker Hub) β’ pulls all layers not already cached. | |
docker push myuser/myapp:1.0 | β’ Uploads an image to a registry β’ requires authentication via docker login. | |
docker tag myapp:1.0 myapp:latest | β’ Creates a new tag pointing to the same image β’ does not copy the image. | |
docker rmi nginx:alpine | β’ Removes an image β’ fails if containers use it unless -f forces removal. | |
docker history nginx | β’ Shows all layers in an image with size and creation command β’ useful for debugging image bloat. | |
docker save -o app.tar myapp:1.0 | Exports image to a tar archive preserving all layers and metadata. | |
docker load -i app.tar | β’ Imports image from tar archive β’ restores all layers and tags. | |
docker import rootfs.tar myapp:1.0 | β’ Creates image from a tarball filesystem β’ no layer history preserved. | |
docker export web -o web.tar | β’ Exports container's filesystem as tar β’ flattens all layers, loses history. | |
docker commit web myapp:snapshot | β’ Creates a new image from a container's changes β’ useful for debugging, avoid for production workflows. | |
docker search --limit 5 nginx | β’ Searches Docker Hub for images β’ --limit restricts results, --filter for stars or official status. |
Table 4: Dockerfile Instructions
| Instruction | Example | Description |
|---|---|---|
FROM node:18-alpine | β’ Sets the base image β’ every Dockerfile starts with FROM β’ use specific tags, never latest in production. | |
RUN apt-get update && apt-get install -y curl | β’ Executes commands during build time β’ each RUN creates a new layer β’ chain commands with && to reduce layers. | |
CMD ["npm", "start"] | β’ Provides default command when container starts β’ overridden by docker run argumentsβ’ use exec form (JSON array). | |
ENTRYPOINT ["python", "app.py"] | β’ Sets the main executable β’ not easily overridden, CMD becomes arguments to ENTRYPOINT. | |
COPY package*.json ./ | β’ Copies files from build context to image β’ preferred over ADD for simple file copying. | |
ADD app.tar.gz /app/ | β’ Like COPY but auto-extracts tar archives and supports URLs β’ use COPY unless you need extraction. | |
WORKDIR /app | β’ Sets working directory for subsequent instructions β’ creates directory if it doesn't exist. | |
ENV NODE_ENV=production | β’ Sets environment variables available at both build and runtime β’ persists in running containers. | |
ARG VERSION=1.0 | β’ Defines build-time variables β’ not available in running containers, used with --build-arg. | |
EXPOSE 8080 | β’ Documents which ports the container listens on β’ does not publish ports, only metadata. | |
VOLUME /data | β’ Creates a mount point for persistent data β’ anonymous volume created if not specified at runtime. | |
USER node | β’ Sets the user for running subsequent commands and the container β’ critical for security, avoid root. | |
LABEL version="1.0" | β’ Adds metadata as key-value pairs β’ queryable with docker inspect, useful for versioning. | |
HEALTHCHECK CMD curl -f || exit 1 | β’ Defines how Docker tests if container is healthy β’ runs periodically, marks container unhealthy on failure. | |
STOPSIGNAL SIGQUIT | β’ Sets the system call signal sent to stop the container β’ default is SIGTERM, useful for apps needing different shutdown signals. | |
SHELL ["/bin/bash", "-c"] | β’ Overrides the default shell for shell-form commands β’ default is ["/bin/sh", "-c"] on Linux, enables bash-specific features. | |
ONBUILD COPY . /app | β’ Adds a trigger instruction executed when image is used as base for another build β’ useful for framework base images. |
Table 5: Build Optimization Techniques
| Technique | Example | Description |
|---|---|---|
FROM golang AS builderFROM alpineCOPY --from=builder /app . | β’ Uses multiple FROM statements to create separate build stages β’ copy only artifacts to final image, drastically reduces size. | |
COPY package*.json ./RUN npm installCOPY . . | β’ Docker caches each layer β’ order instructions least to most frequently changed to maximize cache hits. | |
COPY --link requirements.txt . | β’ Makes the layer independent of its parent layers β’ changing earlier layers does not invalidate this layer's cache, improving resilience in multi-stage and large builds. | |
node_modules*.log.git | β’ Excludes files from build context β’ reduces context size and prevents secrets from being copied. | |
RUN --mount=type=cache,target=/root/.npm npm install | β’ Mounts a persistent cache during build β’ npm/pip/apt caches survive rebuilds, speeds up dependency installs. | |
RUN --mount=type=secret,id=token curl -H "Auth: $(cat /run/secrets/token)" | β’ Injects secrets without storing in image layers β’ secrets never appear in history or cache. | |
FROM alpine:3.21 | β’ Use alpine, distroless, or DHI images β’ reduce attack surface and image size (alpine ~5MB vs ubuntu ~80MB). | |
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* | β’ Chain commands with && to create single layerβ’ clean up package caches in same layer to reduce size. | |
docker buildx build --platform linux/amd64,linux/arm64 -t app . | β’ Builds images for multiple architectures (amd64, arm64) in one command β’ essential for M1/M2 Macs and ARM servers. |
Table 6: Port Publishing and Networking
| Option | Example | Description |
|---|---|---|
docker run -p 8080:80 nginx | β’ Maps host port to container port β’ format hostPort:containerPort, makes service accessible externally. | |
docker run -P nginx | β’ Publishes all EXPOSE'd ports to random high ports on host β’ query with docker port. | |
docker run -p 127.0.0.1:8080:80 nginx | β’ Binds to a specific host IP β’ limits access to localhost or a particular network interface. | |
docker run -p 8000-8010:8000-8010 app | β’ Maps a range of ports β’ useful for services needing multiple consecutive ports. | |
docker run -p 53:53/udp dns | β’ Publishes UDP instead of TCP β’ add /udp suffix to port mapping. |
Table 7: Network Modes
| Mode | Example | Description |
|---|---|---|
docker run --network bridge nginx | β’ Creates a virtual network on host β’ containers get private IPs, communicate via internal DNS, NAT for external access. | |
docker run --network host nginx | β’ Container shares host's network stack β’ no isolation, container binds to host ports directly, best performance. | |
docker run --network none app | β’ No networking β’ container is completely isolated, useful for batch jobs or maximum security. | |
docker network create --driver overlay mynet | β’ Enables multi-host networking for Swarm β’ containers on different hosts communicate as if on same LAN. | |
docker network create -d macvlan mynet | β’ Assigns MAC address to container β’ appears as physical device on network, useful for legacy apps. | |
docker network create -d ipvlan mynet | β’ Like macvlan but containers share parent interface's MAC β’ avoids MAC address exhaustion. |
Table 8: Network Management
| Command | Example | Description |
|---|---|---|
docker network create mynet | β’ Creates a user-defined bridge network β’ enables automatic DNS resolution between containers. | |
docker network ls | Lists all networks with driver type and scope. | |
docker network connect mynet web | β’ Connects a running container to an additional network β’ containers can be on multiple networks. | |
docker network disconnect mynet web | Removes container from a network while it's running. | |
docker network inspect mynet | Shows detailed network configuration including connected containers and IP addresses. | |
docker network rm mynet | β’ Removes a network β’ fails if containers are connected. | |
docker network prune | β’ Removes all unused networks β’ confirms before deletion. | |
curl http://host.docker.internal:3000 | β’ DNS name resolving to the host machine from inside a container β’ auto-configured on Mac/Windows; on Linux add --add-host=host.docker.internal:host-gateway to docker run. |
Table 9: Volume Management
| Type | Example | Description |
|---|---|---|
docker run -v data:/app/data nginx | β’ Docker-managed volumes stored in /var/lib/docker/volumes/β’ preferred for production, portable across hosts. | |
docker run --mount type=volume,source=mydata,target=/data nginx | β’ Explicit, readable alternative to the -v flagβ’ supports type=bind, type=volume, type=tmpfs; recommended for clarity and scripting. | |
docker run -v /host/path:/container/path nginx | β’ Maps a host directory to container β’ changes sync in real-time, ideal for development. | |
docker run --tmpfs /tmp nginx | β’ Stores data in host memory β’ not persisted to disk, ultra-fast, useful for caches and temporary files. | |
docker run -v /app/data nginx | β’ Created automatically with random name β’ hard to manage, removed with container unless --rm is not used. | |
docker run -v data:/app:ro nginx | β’ Mounts volume as read-only β’ container cannot modify host files, improves security. | |
docker run --volumes-from web nginx | β’ Shares all volumes from another container β’ useful for backup containers. |
Table 10: Volume Commands
| Command | Example | Description |
|---|---|---|
docker volume create mydata | β’ Creates a named volume before using it β’ can specify driver and options. | |
docker volume ls | Lists all volumes with driver and mount point. | |
docker volume inspect mydata | Shows volume metadata including mountpoint on host filesystem. | |
docker volume rm mydata | β’ Removes a volume β’ fails if in use by any container. | |
docker volume prune | β’ Deletes all unused volumes β’ dangerous in production, confirms before deletion. |
Table 11: Resource Constraints
| Flag | Example | Description |
|---|---|---|
docker run -m 512m nginx | β’ Limits container memory β’ container killed if exceeded (OOM), suffix: b k m g. | |
docker run --memory-reservation 256m nginx | β’ Soft limit β’ Docker tries to enforce when host memory is low, container can exceed it. | |
docker run --cpus 1.5 nginx | β’ Limits container to 1.5 CPU cores β’ can be fractional (0.5 = 50% of one core). | |
docker run --cpu-shares 512 nginx | β’ Sets relative weight for CPU time β’ default 1024, container with 2048 gets 2x CPU time. | |
docker run --cpuset-cpus 0,1 nginx | β’ Pins container to specific CPU cores β’ useful for NUMA systems and performance-critical apps. | |
docker run --pids-limit 100 nginx | β’ Limits number of PIDs (processes/threads) β’ prevents fork bombs. | |
docker run --blkio-weight 500 nginx | β’ Sets disk I/O priority β’ default 500, range 10-1000. | |
docker run --gpus all nvidia/cuda:12.0-base nvidia-smi | β’ Grants container access to GPU devices β’ requires NVIDIA Container Toolkit; use "device=0,1" to target specific GPUs. |
Table 12: Restart Policies
| Policy | Example | Description |
|---|---|---|
docker run --restart no nginx | β’ Never restart container automatically β’ manual restart required. | |
docker run --restart on-failure:3 nginx | β’ Restarts only if container exits with non-zero code β’ optional max retry count. | |
docker run --restart always nginx | β’ Always restarts container, even after host reboot β’ use for critical services. | |
docker run --restart unless-stopped nginx | β’ Like always but respects manual stopsβ’ doesn't restart if explicitly stopped before reboot. |
Table 13: Health Checks
| Option | Example | Description |
|---|---|---|
HEALTHCHECK --interval=30s CMD curl -f http://localhost/|| exit 1 | β’ Defines in Dockerfile how to test if container is healthy β’ runs periodically. | |
docker run --health-cmd "curl -f http://localhost/" | β’ Runtime override of HEALTHCHECK β’ useful for testing without rebuilding image. | |
docker run --health-interval=10s nginx | β’ Time between health checks β’ default 30s. | |
docker run --health-timeout=5s nginx | β’ How long to wait for check to complete β’ default 30s, fails if exceeded. | |
docker run --health-retries=3 nginx | β’ Number of consecutive failures before marking unhealthy β’ default 3. | |
docker run --health-start-period=60s nginx | β’ Grace period before starting checks β’ allows slow apps to initialize, default 0s. |
Table 14: Docker Compose Services
| Attribute | Example | Description |
|---|---|---|
image: nginx:alpine | β’ Specifies the image to use β’ pulled from registry if not local. | |
build: context: . dockerfile: Dockerfile.prod | β’ Builds image from Dockerfile β’ context is build directory, dockerfile is optional custom name. | |
ports: - "8080:80" | β’ Publishes ports β’ short syntax "host:container" or long syntax with protocol. | |
volumes: - ./data:/data:ro | β’ Mounts volumes or bind mounts β’ supports short and long syntax with options. | |
environment: NODE_ENV: production | β’ Sets environment variables β’ also supports array syntax and .env files. | |
depends_on: db: condition: service_healthy | β’ Defines startup order and conditions β’ service_healthy waits for health checks. | |
networks: - frontend | β’ Connects service to custom networks β’ enables network isolation. | |
restart: unless-stopped | β’ Sets restart policy β’ options: no, always, on-failure, unless-stopped. | |
command: npm run dev | β’ Overrides default CMD from image β’ shell or exec form. | |
entrypoint: /app/entrypoint.sh | β’ Overrides ENTRYPOINT from image β’ rarely needed. | |
healthcheck: test: ["CMD", "curl", "-f", "http://localhost/"] interval: 30s | β’ Defines a health check in Compose β’ supports test, interval, timeout, retries, start_period. | |
deploy: resources: limits: memory: 512M | β’ Configures deployment and resource constraints β’ works in Compose for resource limits and GPU reservations. |
Table 15: Docker Compose Commands
| Command | Example | Description |
|---|---|---|
docker compose up -d | β’ Creates and starts all services β’ -d runs detached, rebuilds if Dockerfile changed. | |
docker compose down -v | β’ Stops and removes containers, networks β’ -v also removes volumes, dangerous in production. | |
docker compose ps | Lists containers for this Compose project only. | |
docker compose logs -f web | β’ Shows logs from services β’ -f follows, specify service name to filter. | |
docker compose exec web sh | β’ Runs command in a running service β’ defaults to first container if replicated. | |
docker compose build --no-cache | β’ Builds or rebuilds services β’ --no-cache forces full rebuild. | |
docker compose pull | Pulls latest images for all services from registry. | |
docker compose restart web | Restarts running services without recreating containers. | |
docker compose stop | β’ Stops services without removing containers β’ faster than down. | |
docker compose start | β’ Starts stopped services β’ doesn't create new containers. | |
docker compose run --rm web npm test | β’ Runs a one-off command against a service β’ --rm removes container after exit, does not start linked services by default. | |
docker compose watch | β’ Watches for file changes and auto-updates running services β’ actions: sync, rebuild, sync+restart. |
Table 16: Docker Compose Advanced Features
| Feature | Example | Description |
|---|---|---|
profiles: [debug] | β’ Groups services for selective activation β’ docker compose --profile debug up only starts debug services. | |
extends: file: common.yml service: base | β’ Inherits configuration from another service β’ enables reusable base definitions. | |
docker-compose.override.yml | β’ Automatically merged with docker-compose.ymlβ’ environment-specific overrides without modifying base file. | |
include: - monitoring.yml | β’ Includes separate Compose files β’ combines multiple projects into one. | |
env_file: - .env.prod | β’ Loads environment variables from files β’ keeps secrets out of Compose file. | |
secrets: - db_password | β’ Injects secrets as files in container β’ mounted at /run/secrets/. | |
configs: - nginx.conf | β’ Like secrets but for non-sensitive config files β’ also mounted as files. | |
develop: watch: - action: sync path: ./src target: /app/src | β’ Configures hot-reload for development β’ actions: sync (copy files), rebuild (rebuild image), sync+restart (copy and restart). | |
x-common: &common restart: alwaysservices: web: <<: *common | β’ Reuses config blocks with anchors and aliases β’ x- prefix defines extension fields that Compose ignores. | |
deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] | β’ Requests GPU access for a service β’ requires NVIDIA Container Toolkit installed on host. |
Table 17: Registry and Authentication
| Command | Example | Description |
|---|---|---|
docker login registry.example.com | β’ Authenticates to a registry β’ stores credentials in ~/.docker/config.json. | |
docker logout | Removes stored credentials for default registry or specified one. | |
docker login -u user -p pass | β’ Non-interactive login β’ avoid in scripts, use stdin or token instead. | |
echo $TOKEN | docker login -u user --password-stdin | β’ Passes password via stdin β’ more secure than command-line password. |
Table 18: Image Tagging Strategies
| Strategy | Example | Description |
|---|---|---|
myapp:1.2.3 | β’ Uses major.minor.patch format β’ best practice for release tracking and rollbacks. | |
myapp:a3f2c1b | β’ Tags with Git commit hash β’ enables exact source code traceability. | |
myapp:prod-1.2.3 | β’ Includes environment prefix β’ clearly indicates deployment target. | |
myapp:2026-03-01 | β’ Timestamps with YYYY-MM-DD β’ useful for nightly builds or time-based releases. | |
myapp:feature-auth | β’ Tags with branch name β’ tracks feature development images. |
Table 19: Cleanup and Maintenance
| Command | Example | Description |
|---|---|---|
docker system prune -a | β’ Removes stopped containers, unused networks, dangling images β’ -a removes all unused images. | |
docker image prune -a --filter "until=168h" | β’ Removes unused images β’ --filter "until=168h" keeps images created in last 7 days. | |
docker container prune | β’ Removes all stopped containers β’ confirms before deletion. | |
docker volume prune | β’ Deletes unused volumes β’ extremely dangerous in production, back up first. | |
docker network prune | β’ Removes unused networks β’ safe operation. | |
docker builder prune | β’ Clears BuildKit cache β’ frees disk space from layer caching. |
Table 20: Logging Drivers
| Driver | Example | Description |
|---|---|---|
--log-driver json-file | β’ Stores logs as JSON on disk β’ queryable with docker logs, limited rotation. | |
--log-driver local | β’ Optimized local file driver with automatic log rotation β’ better performance than json-file. | |
--log-driver syslog --log-opt syslog-address=udp://host:514 | β’ Forwards logs to syslog daemon β’ integrates with centralized logging. | |
--log-driver journald | β’ Sends logs to systemd journal β’ query with journalctl. | |
--log-driver fluentd --log-opt fluentd-address=host:24224 | β’ Forwards to Fluentd collector β’ popular for Kubernetes and centralized logging. | |
--log-driver awslogs --log-opt awslogs-group=myapp | β’ Sends logs to AWS CloudWatch Logs β’ requires AWS credentials. | |
--log-driver gcplogs | β’ Forwards to Google Cloud Logging β’ auto-detects GCP metadata. | |
--log-driver splunk --log-opt splunk-token=XXX | β’ Sends logs to Splunk HTTP Event Collector β’ enterprise logging solution. |
Table 21: Security Practices
| Practice | Example | Description |
|---|---|---|
USER node | β’ Creates and switches to non-root user β’ prevents privilege escalation attacks. | |
docker run --read-only nginx | β’ Makes container filesystem immutable β’ prevents tampering, use tmpfs for writable dirs. | |
docker run --cap-drop ALL --cap-add NET_BIND_SERVICE nginx | β’ Removes Linux capabilities β’ principle of least privilege, drop ALL then add only needed ones. | |
RUN --mount=type=secret,id=token | β’ Never hardcode secrets in images β’ use BuildKit secrets or runtime secrets. | |
docker scout cves nginx:latest | β’ Scans for vulnerabilities β’ integrates with Docker Scout, Trivy, Snyk. | |
FROM gcr.io/distroless/static | β’ Use distroless or alpine β’ fewer packages = smaller attack surface. | |
Avoid --privileged | β’ Never use in production β’ gives full host access, defeats containerization. | |
--security-opt seccomp=profile.json | β’ Apply seccomp/AppArmor/SELinux profiles β’ restricts syscalls and actions. | |
dockerd-rootless-setuptool.sh install | β’ Runs Docker daemon without root privileges β’ mitigates potential vulnerabilities in daemon and container runtime. | |
docker run --security-opt no-new-privileges nginx | β’ Prevents processes from gaining additional privileges via setuid/setgid β’ critical for defense in depth. | |
FROM dhi.io/python:3.12 | β’ Docker's distroless-based, CVE-free base images β’ free since Dec 2025, auto-patched within 24hrs, include SBOM and provenance attestations. |
Table 22: Signal Handling
| Signal | Example | Description |
|---|---|---|
Sent by docker stop | β’ Graceful shutdown signal β’ application should clean up resources and exit within grace period (default 10s). | |
Sent after grace period | β’ Force kill signal β’ cannot be caught or ignored, immediate termination. | |
Ctrl+C in attached mode | β’ Interrupt signal β’ often handled same as SIGTERM by applications. | |
docker kill -s SIGHUP web | β’ Hangup signal β’ commonly used to reload configuration without restart. | |
CMD ["app"] vs CMD app | β’ Exec form (JSON array) makes app PID 1, receives signals β’ shell form wraps in /bin/sh -c, signals go to shell. |
Table 23: Context and Remote Docker
| Command | Example | Description |
|---|---|---|
docker context create remote --docker "host=ssh://user@host" | β’ Creates a remote Docker context β’ enables managing remote Docker daemons. | |
docker context use remote | β’ Switches active context β’ all docker commands target this daemon. | |
docker context ls | Lists all contexts with current one marked by *. | |
docker context rm remote | β’ Removes a context β’ cannot remove active context. | |
export DOCKER_HOST=ssh://user | β’ Sets remote daemon via environment variable β’ alternative to contexts. |
Table 24: Docker Swarm Basics
| Command | Example | Description |
|---|---|---|
docker swarm init | β’ Initializes a Swarm cluster β’ current node becomes manager. | |
docker swarm join --token TOKEN host:2377 | Joins a node to existing Swarm as worker or manager. | |
docker service create --replicas 3 nginx | Creates a Swarm service with replicas across cluster. | |
docker service scale web=5 | Scales service to specified number of replicas. | |
docker service update --image nginx:1.21 web | β’ Rolling update of service β’ updates containers one by one. | |
docker node ls | Lists all nodes in Swarm with status and availability. | |
docker stack deploy -c compose.yml myapp | β’ Deploys a Compose file to Swarm β’ creates all services, networks, volumes. |
Table 25: Environment Variables
| Method | Example | Description |
|---|---|---|
docker run -e NODE_ENV=prod nginx | β’ Sets single variable β’ most direct method, visible in docker inspect. | |
docker run --env-file .env nginx | β’ Loads variables from file β’ one VAR=value per line, comments with #. | |
ENV NODE_ENV=production | β’ Bakes variables into image β’ persists in all containers, bad for secrets. | |
ARG VERSION=1.0 | β’ Build-time only variables β’ passed with --build-arg, not in final image. | |
environment: NODE_ENV: prod | β’ Sets variables in Compose file β’ applies to that service only. | |
env_file: .env | β’ Loads variables from file in Compose β’ supports multiple files. |
Table 26: Inspect and Debug
| Command | Example | Description |
|---|---|---|
docker inspect --format '{{.State.Status}}' web | β’ Shows raw JSON config β’ use --format with Go templates to extract specific fields. | |
docker events --filter type=container | β’ Live stream of daemon events β’ shows create, start, stop, die, etc. | |
docker system df -v | β’ Shows disk usage by images, containers, volumes β’ -v for detailed breakdown. | |
docker system info | Displays system-wide information including storage driver, kernel version, containers count. | |
docker version | Shows client and server versions with API version and Go version. | |
docker debug web | β’ Launches a debug shell attached to container's namespaces β’ requires Docker Desktop; works even on containers without a shell. | |
docker init | β’ Generates Dockerfile, compose.yaml, .dockerignore for a project β’ supports Go, Node, Python, Rust, Java, PHP, ASP.NET templates. |
Table 27: Copy Operations
| Command | Example | Description |
|---|---|---|
docker cp web:/app/log.txt ./log.txt | β’ Copies file from container to host β’ works on running and stopped containers. | |
docker cp ./config.yml web:/app/config.yml | β’ Copies file from host to container β’ immediately available in running container. | |
docker cp web:/app/logs ./logs | Recursively copies entire directories. | |
docker cp -a web:/app ./backup | β’ Preserves UID/GID and permissions β’ equivalent to cp -a. |
Table 28: BuildKit Advanced Features
| Feature | Example | Description |
|---|---|---|
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt | β’ Persists package manager cache across builds β’ dramatically speeds up dependency installs. | |
RUN --mount=type=ssh git clone git:repo | β’ Forwards SSH agent into build β’ enables private Git repos without storing keys. | |
RUN --mount=type=bind,source=.,target=/src make build | β’ Mounts files into build without COPY β’ doesn't add to image layers. | |
docker build --cache-from type=registry,ref=myapp:cache | β’ Uses remote cache from registry β’ enables cache sharing across CI runners. | |
docker build --cache-to type=inline | β’ Embeds cache metadata in image β’ simplest cache sharing method. | |
docker buildx build --sbom=true -t myapp . | β’ Embeds a Software Bill of Materials as an OCI attestation β’ lists all packages and dependencies discovered in the image. | |
docker buildx build --provenance=mode=max -t myapp . | β’ Records SLSA-compliant build provenance β’ cryptographically proves what commit, CI runner, and inputs produced the image. | |
docker buildx bake -f docker-bake.hcl | β’ Builds multiple targets from an HCL/JSON/Compose definition file β’ enables complex build pipelines with shared variables and matrix builds. |
Table 29: Docker Scout Commands
| Command | Example | Description |
|---|---|---|
docker scout cves nginx:latest | β’ Scans an image for CVEs β’ shows severity, CVSS score, affected package, and fix availability. | |
docker scout quickview nginx:latest | β’ Displays a summary of vulnerabilities and policy compliance β’ fast overview without printing the full CVE list. | |
docker scout recommendations nginx:latest | β’ Suggests base image upgrades that reduce the CVE count β’ shows how many CVEs each alternative version would eliminate. | |
docker scout sbom nginx:latest | β’ Generates a Software Bill of Materials β’ lists all packages, versions, and licenses found in the image. | |
docker scout compare nginx:1.25 --to nginx:latest | β’ Compares vulnerability profiles of two images β’ useful to verify CVE reduction after a base image update. | |
docker scout enroll myorg | β’ Enrolls an organization in Docker Scout β’ enables policy enforcement, repository integration, and team dashboards. |
Table 30: Docker Model Runner
| Command | Example | Description |
|---|---|---|
docker model pull ai/llama3.2 | β’ Downloads an AI model from Docker Hub β’ models are versioned and stored locally, managed like images. | |
docker model run ai/llama3.2 | β’ Runs a model interactively in the terminal β’ provides a live chat interface for direct prompting. | |
docker model run -d --name llm ai/llama3.2 | β’ Starts model as a background service β’ accessible via OpenAI-compatible REST API from host or other containers. | |
docker model list | Lists all locally downloaded AI models with size and status. | |
docker model rm ai/llama3.2 | Removes a downloaded model from local storage. | |
curl http://model-runner.docker.internal/engines/v1/chat/completions | β’ Access running model via OpenAI-compatible endpoint β’ use from other containers; also accessible on host at http://localhost:12434/engines/v1. |
Table 31: Docker Build Cloud
| Feature | Example | Description |
|---|---|---|
docker buildx create --driver cloud myorg/mybuilder | β’ Creates a remote cloud-based builder β’ builds run in Docker's infrastructure, not on the local machine. | |
docker buildx build --builder cloud-myorg/mybuilder -t myapp . | β’ Sends build to cloud infrastructure β’ more CPU/RAM than local, shared cache across the whole team. | |
docker buildx use cloud-myorg/mybuilder | Sets the cloud builder as default for all subsequent docker buildx build commands. | |
docker buildx ls | Lists all available builders including cloud builders and their status. | |
(automatic across team) | β’ All team members share a persistent remote cache β’ first build warms cache, subsequent team builds dramatically faster. |
Table 32: Compose Dependency Conditions
| Condition | Example | Description |
|---|---|---|
depends_on: db: condition: service_started | β’ Waits for service to be started β’ doesn't guarantee it's ready, default behavior. | |
depends_on: db: condition: service_healthy | β’ Waits for health check to pass β’ requires HEALTHCHECK in image or Compose. | |
depends_on: migrate: condition: service_completed_successfully | β’ Waits for one-off task to exit with code 0 β’ useful for migrations. |
Table 33: Distroless and Minimal Images
| Image | Example | Description |
|---|---|---|
FROM alpine:3.21 | β’ Lightweight 5MB base β’ uses musl libc, may have compatibility issues with compiled binaries. | |
FROM gcr.io/distroless/static-debian12 | β’ No shell, no package manager β’ only runtime dependencies, ultimate security and size reduction. | |
FROM scratch | β’ Empty base image β’ use for static binaries only (Go, Rust), absolute minimal size. | |
FROM gcr.io/distroless/base-debian12:debug | β’ Adds busybox shell to distroless β’ only for debugging, never production. | |
FROM dhi.io/python:3.12 | β’ Docker's distroless-based, CVE-free official images β’ free since Dec 2025, auto-patched within 24hrs, include SBOM and provenance attestations. |
References
Official Documentation
- Docker Documentation β https://docs.docker.com/
- Docker Reference Documentation β https://docs.docker.com/reference/
- Dockerfile Reference β https://docs.docker.com/reference/dockerfile/
- Docker Compose Reference β https://docs.docker.com/reference/compose-file/
- Docker CLI Reference β https://docs.docker.com/reference/cli/docker/
- Docker Engine API β https://docs.docker.com/reference/api/engine/
- Docker Build Reference β https://docs.docker.com/build/
- Docker BuildKit Documentation β https://docs.docker.com/build/buildkit/
- Docker Networking Overview β https://docs.docker.com/engine/network/
- Docker Storage Documentation β https://docs.docker.com/engine/storage/
- Docker Security Documentation β https://docs.docker.com/engine/security/
- Docker Swarm Documentation β https://docs.docker.com/engine/swarm/
- Docker Registry Documentation β https://docs.docker.com/registry/
- Docker Hub Documentation β https://docs.docker.com/docker-hub/
- Docker Desktop Documentation β https://docs.docker.com/desktop/
- Docker Extensions Documentation β https://docs.docker.com/extensions/
- Docker Scout Documentation β https://docs.docker.com/scout/
Technical Blogs & Tutorials
- The Complete Guide to Docker Commands: From Beginner to Advanced β https://medium.com/@aravindcsebe/the-complete-guide-to-docker-commands-from-beginner-to-advanced-b139ae6f3838
- Top 55+ Basic Docker Commands You Must Learn in 2026 β https://www.knowledgehut.com/blog/devops/basic-docker-commands
- Docker Commands Explained: From Beginner to Production-Ready β https://aws.plainenglish.io/docker-commands-explained-from-beginner-to-production-ready-in-one-guide-eb8235f1f4b2
- Docker in 2026: The Container Journey Every DevOps Engineer Must Take β https://medium.com/@salwan.mohamed/docker-in-2026-the-container-journey-every-devops-engineer-must-take-47a7c4ac8192
- From Kitchen to Cloud: Your 2026 Guide to Mastering Docker Container Images β https://medium.com/@salwan.mohamed/from-kitchen-to-cloud-your-2026-guide-to-mastering-docker-container-images-789434dad895
- The Ultimate Guide to Docker in 2026: Containers, AI Workflows, and the End of "It Works On My Machine" β https://www.careerdastak.com/blog/the-ultimate-guide-to-docker-in-2026-containers-ai-workflows-and-the-end-of-it-works-on-my-machine-371812
- Docker for Full Stack Developers in 2026: Containers, Compose, and Production Workflows β https://www.nucamp.co/blog/docker-for-full-stack-developers-in-2026-containers-compose-and-production-workflows
- Docker Learning Roadmap: Beginner to Expert (2026) β https://www.coursera.org/resources/docker-learning-roadmap
Building Best Practices
- Building Best Practices β Docker Docs β https://docs.docker.com/build/building/best-practices/
- Top 20 Dockerfile Best Practices β Sysdig β https://www.sysdig.com/learn-cloud-native/dockerfile-best-practices
- Dockerfile Performance Optimization: Best Practices Explained β https://medium.com/@vasanthancomrads/dockerfile-performance-optimization-best-practices-explained-25d85877f12b
- Best Practices and Tips for Writing a Dockerfile β Qovery β https://www.qovery.com/blog/best-practices-and-tips-for-writing-a-dockerfile
- Docker Best Practices 2026 [Updated] β Thinksys Inc. β https://thinksys.com/devops/docker-best-practices/
- Docker Best Practices: Using ARG and ENV in Your Dockerfiles β https://www.docker.com/blog/docker-best-practices-using-arg-and-env-in-your-dockerfiles/
- Docker Best Practices: Choosing Between RUN, CMD, and ENTRYPOINT β https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/
- Using Tags and Labels to Manage Docker Image Sprawl β https://www.docker.com/blog/docker-best-practices-using-tags-and-labels-to-manage-docker-image-sprawl/
- 12 Docker Best Practices Every Developer Should Follow in Production β https://levelup.gitconnected.com/12-docker-best-practices-every-developer-should-follow-in-production-fdadd3976f4a
- Docker Build and Buildx Best Practices for Optimized Builds β https://northflank.com/blog/docker-build-and-buildx-best-practices-for-optimized-builds
Multi-Stage Builds & Optimization
- Multi-stage Builds β Docker Docs β https://docs.docker.com/build/building/multi-stage/
- How to Optimize Docker Images with Multi-Stage Builds β https://oneuptime.com/blog/post/2026-02-20-docker-multi-stage-builds/view
- How to Optimize Docker Image Size with Multi-Stage Builds β https://oneuptime.com/blog/post/2026-01-25-optimize-docker-image-size-multi-stage-builds/view
- Shrink Your Docker Images by ~50% with Multi-Stage Builds β https://nickjanetakis.com/blog/shrink-your-docker-images-by-50-percent-with-multi-stage-builds
- Understanding Multi-Stage Docker Builds β Blacksmith β https://www.blacksmith.sh/blog/understanding-multi-stage-docker-builds
- Our Docker Images Were 2GB. I Got Them to 80MB β https://blog.devops.dev/our-docker-images-were-2gb-i-got-them-to-80mb-1776f9acfd13
BuildKit & Caching
- Optimize Cache Usage in Builds β Docker Docs β https://docs.docker.com/build/cache/optimize/
- Advanced Docker BuildKit Optimization Techniques β https://medium.com/@vasanthancomrads/advanced-docker-buildkit-optimization-techniques-b469552b831e
- How to Optimize Docker Build Times with Layer Caching β https://oneuptime.com/blog/post/2026-01-16-docker-optimize-build-times/view
- How to Use Docker BuildKit Cache Mounts and Secrets β https://oneuptime.com/blog/post/2026-01-16-docker-buildkit-cache-secrets/view
- Docker BuildKit Deep Dive: Optimize Your Build Performance β https://tech.sparkfabrik.com/en/blog/docker-cache-deep-dive/
- Docker Build Cache Worked Locally. Broke in CI Every Time β https://aws.plainenglish.io/docker-build-cache-worked-locally-broke-in-ci-every-time-c9aa6e7c5f80
- The Ultimate Guide to Docker Build Cache β Depot β https://depot.dev/blog/ultimate-guide-to-docker-build-cache
- Docker Layer Caching in CI Pipelines Cut Build Times by 70 β https://www.netdata.cloud/academy/docker-layer-caching/
- Faster CI Builds with Docker Layer Caching and BuildKit β https://testdriven.io/blog/faster-ci-builds-with-docker-cache/
- Image Rebase and Improved Remote Cache Support in New BuildKit β https://docs.docker.com/blog/image-rebase-and-improved-remote-cache-support-in-new-buildkit/
- How to Use COPY --link for Better Layer Caching β https://oneuptime.com/blog/post/2026-02-08-how-to-use-copy-link-for-better-layer-caching/
Security Best Practices
- Container Security in 2026: 7 Key Components, Risks & Defenses β https://checkmarx.com/learn/container-security/container-security-in-2026-7-key-components-risks-defenses/
- Container Security Best Practices: An Enterprise Guide for 2026 β https://www.ox.security/blog/container-security-best-practices/
- 10 Container Security Best Practices for Enterprises in 2026 β https://www.portainer.io/blog/container-security-best-practices
- How to Handle Docker Security Best Practices β https://oneuptime.com/blog/post/2026-02-02-docker-security-best-practices/view
- Docker Security Best Practices in 2026: Hardening Containers from Build to Runtime β https://zeonedge.com/hi/blog/docker-security-best-practices-2026-hardening-containers-build-runtime
- Docker Security Best Practices | Sonatype Guide β https://www.sonatype.com/resources/guides/docker-security-best-practices
- 10 Docker Image Security Best Practices β Snyk β https://snyk.io/blog/10-docker-image-security-best-practices/
- 12 Container Image Scanning Best Practices β Sysdig β https://www.sysdig.com/learn-cloud-native/12-container-image-scanning-best-practices
- Docker Security β OWASP Cheat Sheet Series β https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html
- Container Security: Best Practices for Docker and Kubernetes Environments β https://www.codecademy.com/article/container-security-best-practices-for-docker-and-kubernetes-environments
- Docker Container Security Best Practices for Modern Applications β https://www.wiz.io/academy/container-security/docker-container-security-best-practices
Networking
- Networking β Docker Docs β https://docs.docker.com/engine/network/
- Port Publishing and Mapping β Docker Docs β https://docs.docker.com/engine/network/port-publishing/
- How to Implement Docker Container Networking Modes β https://oneuptime.com/blog/post/2026-01-30-docker-container-networking-modes/view
- Advanced Docker Networking β https://medium.com/@Adekola_Olawale/advanced-docker-networking-85eef5b915f4
- Docker Networking Advanced: Custom Networks and Bridge Modes β https://dohost.us/index.php/2025/07/29/docker-networking-advanced-custom-networks-and-bridge-modes/
- Docker Networking Best Practices: A Beginner-to-Advanced Guide β https://whatsinthecloud.substack.com/p/docker-networking-best-practices
- Mastering Docker Network Modes: Bridge, Host, and None β https://www.linkedin.com/pulse/mastering-docker-network-modes-bridge-host-none-beginners-akash-gupta-xizzf
- How to Map Docker Ports Correctly (Host, Bridge, and Container Modes) β https://oneuptime.com/blog/post/2026-01-16-docker-port-mapping/view
- How to Connect to Services Running in Docker from Host Machine β https://oneuptime.com/blog/post/2026-01-25-connect-to-docker-services-from-host/view
- Docker Desktop Networking Features (host.docker.internal) β https://docs.docker.com/desktop/features/networking/
Storage & Volumes
- Volumes β Docker Docs β https://docs.docker.com/engine/storage/volumes/
- Bind Mounts β Docker Docs β https://docs.docker.com/engine/storage/bind-mounts/
- tmpfs Mounts β Docker Docs β https://docs.docker.com/engine/storage/tmpfs/
- How to Use Docker tmpfs Mounts for Faster I/O β https://oneuptime.com/blog/post/2026-01-16-docker-tmpfs-mounts/view
- Understanding Docker Storage: Volume vs Bind Mounts vs tmpfs Mounts β https://www.linkedin.com/pulse/understanding-docker-storage-volume-vs-bind-mounts-tmpfs-bhowmick-avfif
- Docker Mount Types: Volumes, Bind Mounts & tmpfs Guide β https://www.datacamp.com/tutorial/docker-mount
- Docker Volumes: The 7 Data-Loss Traps and the Safe Patterns β https://blog.stackademic.com/docker-volumes-the-7-data-loss-traps-and-the-safe-patterns-0aeca5add3e2
Docker Compose
- Docker Compose β Docker Docs β https://docs.docker.com/compose/
- Services | Docker Docs β https://docs.docker.com/reference/compose-file/services/
- How to Configure Docker Compose for Development β https://oneuptime.com/blog/post/2026-02-02-docker-compose-development/view
- How to Build Docker Compose for Local Development β https://oneuptime.com/blog/post/2026-01-30-docker-compose-local-development/view
- Docker Compose: Complete Guide with Practical Examples β https://cubepath.com/docs/docker-kubernetes/docker-compose-complete-guide-with-examples
- Control Startup and Shutdown Order in Compose β https://docs.docker.com/compose/how-tos/startup-order/
- How to Wait for Container Dependencies in Docker Compose β https://oneuptime.com/blog/post/2026-01-25-wait-for-container-dependencies-docker-compose/view
- How to Use Docker Compose Depends On β https://oneuptime.com/blog/post/2026-01-25-docker-compose-depends-on/view
- Docker Compose: Speed Up Your Workflow with Profiles, Extends, and depends_on β https://dev.to/altairlage/docker-compose-speed-up-your-workflow-with-profiles-extends-and-dependson-4df8
- Use Service Profiles β Docker Docs β https://docs.docker.com/compose/how-tos/profiles/
- Use Multiple Compose Files β Docker Docs β https://docs.docker.com/compose/how-tos/multiple-compose-files/
- How to Use Docker Compose Extends for Reusable Configurations β https://oneuptime.com/blog/post/2026-01-16-docker-compose-extends/view
- How to Set Up Docker Compose Override Files β https://oneuptime.com/blog/post/2026-01-25-docker-compose-override-files/view
- Advanced Docker Compose: Using Profiles, extends, and depends_on β https://medium.com/@akaashhazarika/advanced-docker-compose-using-profiles-extends-and-depends-on-6f336f56f2de
Resource Management & Monitoring
- Resource Constraints β Docker Docs β https://docs.docker.com/engine/containers/resource_constraints/
- Docker CPU & Memory Limits: Prevent Container Crashes β https://oneuptime.com/blog/post/2026-01-16-docker-limit-cpu-memory/view
- How to Implement Docker Container Resource Limits β https://oneuptime.com/blog/post/2026-01-30-docker-container-resource-limits/view
- Runtime Metrics β Docker Docs β https://docs.docker.com/engine/containers/runmetrics/
- How to Monitor Docker Container Resource Usage in Real Time β https://oneuptime.com/blog/post/2026-01-16-docker-monitor-resource-usage/view
- Advanced Container Resource Monitoring with docker stats β https://last9.io/blog/container-resource-monitoring-with-docker-stats/
- How to Monitor Docker Container Metrics with the OpenTelemetry Docker Stats Receiver β https://oneuptime.com/blog/post/2026-02-06-monitor-docker-container-metrics-opentelemetry-docker-stats-receiver/view
Logging
- Configure Logging Drivers β Docker Docs β https://docs.docker.com/engine/logging/configure/
- Logs and Metrics β Docker Docs β https://docs.docker.com/engine/logging/
- How to Implement Docker Logging Best Practices β https://oneuptime.com/blog/post/2026-01-30-docker-logging-best-practices/view
- How to Set Up Docker Container Logging Drivers β https://oneuptime.com/blog/post/2026-01-25-docker-container-logging-drivers/view
- Mastering Docker Logs: A Comprehensive Tutorial β Dash0 β https://www.dash0.com/guides/mastering-docker-logs
- Docker Logging Guide Part 1: Basic Concepts and Importance β https://www.red-gate.com/simple-talk/devops/containers-and-virtualization/docker-logging-guide-part-1-basic-concepts-and-importance/
- Guide to Docker Logs and How to See Them β New Relic β https://newrelic.com/blog/infrastructure-monitoring/docker-logs
Registry & Authentication
- Docker Login β Docker Docs β https://docs.docker.com/reference/cli/docker/login/
- Registry Authentication β Docker Docs β https://docs.docker.com/reference/api/registry/auth/
- How to Set Up Docker Registry Authentication β https://oneuptime.com/blog/post/2026-01-22-docker-registry-authentication/view
- Private Registry Authentication in Amazon ECR β https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
- Push and Pull Images | Artifact Registry | Google Cloud β https://docs.cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling
Health Checks & Restart Policies
- Start Containers Automatically β Docker Docs β https://docs.docker.com/engine/containers/start-containers-automatically/
- Understanding Docker Restart Policies: always, unless-stopped, on-failure β https://oneuptime.com/blog/post/2026-01-16-docker-restart-policies/view
- Docker Restart Policies: A Complete Guide to Container Resilience β https://infosecwriteups.com/docker-restart-policies-a-complete-guide-to-container-resilience-3be33be0bfef
- Docker Health Check: A Practical Guide β Dash0 β https://www.dash0.com/guides/docker-health-check-a-practical-guide
- How to Set Up Docker Health Checks That Actually Work β https://oneuptime.com/blog/post/2026-01-06-docker-health-checks/view
Signal Handling & Graceful Shutdown
- How to Handle Docker Container Graceful Shutdown and Signal Handling β https://oneuptime.com/blog/post/2026-01-16-docker-graceful-shutdown-signals/view
- How to Set Up Docker Container Signal Handling β https://oneuptime.com/blog/post/2026-01-25-docker-container-signal-handling/view
- SIGKILL vs SIGTERM: A Developer's Guide to Process Termination β https://www.suse.com/c/observability-sigkill-vs-sigterm-a-developers-guide-to-process-termination/
- Trapping Signals in Docker Containers β CloudBees β https://www.cloudbees.com/blog/trapping-signals-in-docker-containers
- Are You Gracefully Shutting Down Your Containers? β https://www.sls.guru/blog/are-you-gracefully-shutting-down-your-containers
- SIGTERM: Linux Graceful Termination | Exit code 143, Signal 15 β https://komodor.com/learn/sigterm-signal-15-exit-code-143-linux-graceful-termination/
Multi-Platform Builds
- Multi-platform Builds β Docker Docs β https://docs.docker.com/build/building/multi-platform/
- How to Use Docker Multi-Platform Builds β https://oneuptime.com/blog/post/2026-02-02-docker-multi-platform/view
- How to Rapidly Build Multi-Architecture Images with Buildx β https://www.docker.com/blog/how-to-rapidly-build-multi-architecture-images-with-buildx/
- How to Implement Multi-Architecture Image Building with Docker Buildx β https://oneuptime.com/blog/post/2026-02-09-multi-arch-docker-buildx/view
- Docker buildx for Multi-Platform Image Builds β https://www.anantacloud.com/post/docker-buildx-for-multi-platform-image-builds-a-practical-guide
Cleanup & Maintenance
- Prune Unused Docker Objects β Docker Docs β https://docs.docker.com/engine/manage-resources/pruning/
- How to Remove Unused Docker Images (Dangling and Unreferenced) β https://oneuptime.com/blog/post/2026-02-08-how-to-remove-unused-docker-images-dangling-and-unreferenced/view
- How to Use Docker Image Prune with Filters β https://oneuptime.com/blog/post/2026-02-08-how-to-use-docker-image-prune-with-filters/view
- How To Remove Docker Images, Containers, and Volumes β https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes
- Tidy Up with docker system prune β Depot β https://depot.dev/blog/docker-system-prune
User Permissions & Security
- Linux Post-Installation Steps for Docker Engine β https://docs.docker.com/engine/install/linux-postinstall/
- How to Set Up Docker Container User Permissions β https://oneuptime.com/blog/post/2026-01-25-docker-container-user-permissions/view
- How to Run Docker Containers as Non-Root Users β https://oneuptime.com/blog/post/2026-01-16-docker-run-non-root-user/view
- Understanding the Docker USER Instruction β https://www.docker.com/blog/understanding-the-docker-user-instruction/
- Why Non-Root Containers Are Important for Security β https://techdocs.broadcom.com/us/en/vmware-tanzu/bitnami-secure-images/bitnami-secure-images/services/bsi-doc/apps-tutorials-why-non-root-containers-are-important-for-security-index.html
- Rootless Mode β Docker Docs β https://docs.docker.com/engine/security/rootless/
Environment Variables
- Build Variables β Docker Docs β https://docs.docker.com/build/building/variables/
- How to Pass Build Arguments and Environment Variables in Docker β https://oneuptime.com/blog/post/2026-01-06-docker-build-args-env-variables/view
- How to Use Docker Environment Variables β https://oneuptime.com/blog/post/2026-01-23-docker-environment-variables/view
- Docker ARG vs ENV: Understanding Build-time and Runtime Variables β https://dev.to/idsulik/docker-arg-vs-env-understanding-build-time-and-runtime-variables-473c
- Set Environment Variables β Docker Docs β https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/
- Setting Docker Environment Variables: The Ultimate Guide β https://configu.com/blog/docker-environment-variables-arg-env-using-them-correctly/
Image Management & Tagging
- How to Handle Docker Image Tagging β https://oneuptime.com/blog/post/2026-02-02-docker-image-tagging/view
- How to Name, Version, and Reference Container Images β https://developers.redhat.com/articles/2025/01/28/how-name-version-and-reference-container-images
- Docker Image Tag β Docker Docs β https://docs.docker.com/reference/cli/docker/image/tag/
- Docker Image Naming and Tagging β DEV Community β https://dev.to/kalkwst/docker-image-naming-and-tagging-1pg9
Inspection & Debugging
- How to Use Docker History to Understand Image Build Steps β https://oneuptime.com/blog/post/2026-02-08-how-to-use-docker-history-to-understand-image-build-steps/view
- How to Debug Docker Build Context and Layer Caching Issues β https://oneuptime.com/blog/post/2026-01-16-docker-debug-build-context-cache/view
- Understanding the Image Layers β Docker Docs β https://docs.docker.com/get-started/docker-concepts/building-images/understanding-image-layers/
Docker Init & Debug
- Docker Init β CLI Reference β https://docs.docker.com/reference/cli/docker/init/
- Docker Debug β CLI Reference β https://docs.docker.com/reference/cli/docker/debug/
- Docker Init: Efficient Containerization β https://www.docker.com/blog/docker-init-initialize-dockerfiles-and-compose-files-with-a-single-cli-command/
Docker Compose Watch & Development
- Use Compose Watch β Docker Docs β https://docs.docker.com/compose/how-tos/file-watch/
- Docker Compose Run β CLI Reference β https://docs.docker.com/reference/cli/docker/compose/run/
- Docker Compose Watch β CLI Reference β https://docs.docker.com/reference/cli/docker/compose/watch/
- GPU Support in Docker Compose β Docker Docs β https://docs.docker.com/compose/how-tos/gpu-support/
- Compose File Fragments (YAML Anchors) β Docker Docs β https://docs.docker.com/reference/compose-file/fragments/
- Compose Deploy Specification β Docker Docs β https://docs.docker.com/reference/compose-file/deploy/
- Compose Healthcheck β Docker Docs β https://docs.docker.com/reference/compose-file/services/#healthcheck
Container Management CLIs
- Docker Container Rename β CLI Reference β https://docs.docker.com/reference/cli/docker/container/rename/
- Docker Container Update β CLI Reference β https://docs.docker.com/reference/cli/docker/container/update/
- Docker Container Commit β CLI Reference β https://docs.docker.com/reference/cli/docker/container/commit/
- Docker Search β CLI Reference β https://docs.docker.com/reference/cli/docker/search/
Dockerfile Advanced Instructions
- STOPSIGNAL β Dockerfile Reference β https://docs.docker.com/reference/dockerfile/#stopsignal
- SHELL β Dockerfile Reference β https://docs.docker.com/reference/dockerfile/#shell
- ONBUILD β Dockerfile Reference β https://docs.docker.com/reference/dockerfile/#onbuild
- Understand How CMD and ENTRYPOINT Interact β Docker Docs β https://docs.docker.com/reference/dockerfile/#understand-how-cmd-and-entrypoint-interact
- COPY --link β Dockerfile Reference β https://docs.docker.com/reference/dockerfile/#copy---link
BuildKit Advanced & Bake
- Docker Buildx Bake β Docker Docs β https://docs.docker.com/build/bake/
- Bake File Reference β Docker Docs β https://docs.docker.com/build/bake/reference/
- Cache Storage Backends β Docker Docs β https://docs.docker.com/build/cache/backends/
- SBOM Attestations β Docker Docs β https://docs.docker.com/build/metadata/attestations/sbom/
- SLSA Provenance Attestations β Docker Docs β https://docs.docker.com/build/metadata/attestations/slsa-provenance/
Security Advanced
- Rootless Mode β Docker Docs β https://docs.docker.com/engine/security/rootless/
- Docker Scout CVEs β CLI Reference β https://docs.docker.com/reference/cli/docker/scout/cves/
- Docker Scout Quickview β CLI Reference β https://docs.docker.com/reference/cli/docker/scout/quickview/
- Docker Scout Recommendations β CLI Reference β https://docs.docker.com/reference/cli/docker/scout/recommendations/
- Docker Scout SBOM β CLI Reference β https://docs.docker.com/reference/cli/docker/scout/sbom/
- Docker Scout Compare β CLI Reference β https://docs.docker.com/reference/cli/docker/scout/compare/
- Docker Scout Enroll β CLI Reference β https://docs.docker.com/reference/cli/docker/scout/enroll/
- SecComp Security Profiles for Docker β Docker Docs β https://docs.docker.com/engine/security/seccomp/
- AppArmor Security Profiles for Docker β Docker Docs β https://docs.docker.com/engine/security/apparmor/
- Docker Hardened Images β Docker β https://www.docker.com/products/hardened-images/
Docker Swarm & Orchestration
- Docker Swarm Overview β Docker Docs β https://docs.docker.com/engine/swarm/
- Docker Service Create β CLI Reference β https://docs.docker.com/reference/cli/docker/service/create/
- Docker Stack Deploy β CLI Reference β https://docs.docker.com/reference/cli/docker/stack/deploy/
- Portainer Advisory: Docker Swarm β https://www.portainer.io/blog/portainer-technical-advisory-docker-swarm
Distroless & Minimal Images
- GoogleContainerTools Distroless β GitHub β https://github.com/GoogleContainerTools/distroless
- Why Distroless Container Images β Google Cloud Blog β https://cloud.google.com/blog/products/containers-kubernetes/distroless-container-images-improve-security
- Alpine Linux Docker Image β Docker Hub β https://hub.docker.com/_/alpine
- Alpine Linux Release Branches β https://alpinelinux.org/releases/
Docker Model Runner & AI
- Docker Model Runner Overview β Docker Docs β https://docs.docker.com/ai/model-runner/
- Docker Model Runner API Reference β Docker Docs β https://docs.docker.com/ai/model-runner/api-reference/
- Docker Model Run β CLI Reference β https://docs.docker.com/reference/cli/docker/model/run/
- Docker Model Pull β CLI Reference β https://docs.docker.com/reference/cli/docker/model/pull/
- Docker Model List β CLI Reference β https://docs.docker.com/reference/cli/docker/model/ls/
- Docker Model Rm β CLI Reference β https://docs.docker.com/reference/cli/docker/model/rm/
- How to Build, Run, and Package AI Models Locally with Docker Model Runner β https://www.docker.com/blog/how-to-build-run-and-package-ai-models-locally-with-docker-model-runner/
- How We Designed Docker Model Runner and What's Next β https://www.docker.com/blog/how-we-designed-model-runner-and-whats-next/
- Docker Model Runner Cheatsheet 2025 β DEV Community β https://dev.to/ajeetraina/docker-model-runner-cheatsheet-2025-37nd
- Docker Model Runner: Simplifying Local LLM Model Execution β https://securityboulevard.com/2025/12/docker-model-runner-simplifying-local-llm-model-execution/
- Docker MCP Catalog and Toolkit β Docker Blog β https://www.docker.com/blog/docker-mcp-catalog-and-toolkit/
Docker Build Cloud
- Docker Build Cloud β Docker Docs β https://docs.docker.com/build-cloud/
- Docker Build Cloud Setup β Docker Docs β https://docs.docker.com/build-cloud/setup/
- Docker Buildx Create β CLI Reference β https://docs.docker.com/reference/cli/docker/buildx/create/
- Docker Buildx Use β CLI Reference β https://docs.docker.com/reference/cli/docker/buildx/use/
- Docker Buildx Ls β CLI Reference β https://docs.docker.com/reference/cli/docker/buildx/ls/
Additional 2026 Resources
- Docker in 2026: Current State and What's Changed β https://www.docker.com/blog/docker-2025-2026-year-in-review/
- Container Security in 2026: Enterprise Strategies β https://www.wiz.io/academy/container-security/docker-container-security-best-practices
- Docker Desktop Features Overview β https://docs.docker.com/desktop/features/
- Docker Daemon Configuration (daemon.json) β https://docs.docker.com/reference/cli/dockerd/#daemon-configuration-file