Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

πŸ€– Artificial Intelligence
☁️ Cloud and Infrastructure
πŸ’Ύ Data and Databases
πŸ’Ό Professional Skills
🎯 Programming and Development
πŸ”’ Security and Networking
πŸ“š Specialized Topics
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
Β© 2026 CheatGridβ„’. All rights reserved.
Privacy PolicyTerms of UseAboutContact

Docker Cheat Sheet

Docker Cheat Sheet

Tables
Back to Containers Orchestration
Updated 2026-04-01
Next Topic: Docker Compose Cheat Sheet

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.

Quick Index244Β entriesΒ Β·Β 33Β tables
Mind Map

33 tables, 244 concepts. Select a concept node to jump to its table row.

Preparing mind map...

Table 1: Container Lifecycle Management

CommandExampleDescription
docker run
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
docker start web
β€’ Starts an existing stopped container
β€’ preserves all container state and configuration.
docker stop
docker stop web
Gracefully stops a running container by sending SIGTERM then SIGKILL after grace period (default 10s).
docker restart
docker restart web
β€’ Stops then starts a container
β€’ equivalent to stop + start.
docker pause
docker pause web
β€’ Freezes all processes in a container using cgroups
β€’ no CPU/memory usage, instant resume with unpause.
docker unpause
docker unpause web
β€’ Resumes a paused container
β€’ restores execution exactly where it stopped.
docker rm
docker rm -f web
β€’ Removes a stopped container
β€’ -f forces removal of running containers by killing them first.
docker kill
docker kill web
β€’ Immediately stops a container by sending SIGKILL
β€’ no graceful shutdown, use for unresponsive containers.
docker create
docker create --name web nginx
β€’ Creates a container without starting it
β€’ useful for preparing containers before start.
docker wait
docker wait web
β€’ Blocks until a container stops, then prints its exit code
β€’ useful in scripts.
docker rename
docker rename web web-old
β€’ Renames an existing container
β€’ works on running and stopped containers.
docker update
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

CommandExampleDescription
docker ps
docker ps -a
β€’ Lists containers
β€’ default shows running only, -a includes stopped.
docker logs
docker logs -f --tail 100 web
β€’ Shows container stdout/stderr
β€’ -f follows live output, --tail limits lines.
docker exec
docker exec -it web bash
β€’ Runs a new process inside a running container
β€’ -it allocates interactive TTY for shell access.
docker attach
docker attach web
β€’ Connects to container's main process stdin/stdout
β€’ Ctrl+C stops the container.
docker inspect
docker inspect web
Returns detailed JSON with all container metadata including config, state, network, mounts.
docker stats
docker stats web
β€’ Live stream of CPU, memory, network, disk I/O metrics
β€’ press Ctrl+C to stop.
docker top
docker top web
β€’ Shows running processes inside a container
β€’ equivalent to ps inside the container.
docker port
docker port web
β€’ Lists all port mappings for a container
β€’ shows host port β†’ container port bindings.
docker diff
docker diff web
Shows filesystem changes (A=added, C=changed, D=deleted) since container creation.

Table 3: Image Management

CommandExampleDescription
docker build
docker build -t myapp:1.0 .
β€’ Builds an image from a Dockerfile
β€’ -t tags it, . specifies build context directory.
docker images
docker images
Lists all local images with repository, tag, image ID, creation date, and size.
docker pull
docker pull nginx:alpine
β€’ Downloads an image from a registry (default Docker Hub)
β€’ pulls all layers not already cached.
docker push
docker push myuser/myapp:1.0
β€’ Uploads an image to a registry
β€’ requires authentication via docker login.
docker tag
docker tag myapp:1.0 myapp:latest
β€’ Creates a new tag pointing to the same image
β€’ does not copy the image.
docker rmi
docker rmi nginx:alpine
β€’ Removes an image
β€’ fails if containers use it unless -f forces removal.
docker history
docker history nginx
β€’ Shows all layers in an image with size and creation command
β€’ useful for debugging image bloat.
docker save
docker save -o app.tar myapp:1.0
Exports image to a tar archive preserving all layers and metadata.
docker load
docker load -i app.tar
β€’ Imports image from tar archive
β€’ restores all layers and tags.
docker import
docker import rootfs.tar myapp:1.0
β€’ Creates image from a tarball filesystem
β€’ no layer history preserved.
docker export
docker export web -o web.tar
β€’ Exports container's filesystem as tar
β€’ flattens all layers, loses history.
docker commit
docker commit web myapp:snapshot
β€’ Creates a new image from a container's changes
β€’ useful for debugging, avoid for production workflows.
docker search
docker search --limit 5 nginx
β€’ Searches Docker Hub for images
β€’ --limit restricts results, --filter for stars or official status.

Table 4: Dockerfile Instructions

InstructionExampleDescription
FROM
FROM node:18-alpine
β€’ Sets the base image
β€’ every Dockerfile starts with FROM
β€’ use specific tags, never latest in production.
RUN
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
CMD ["npm", "start"]
β€’ Provides default command when container starts
β€’ overridden by docker run arguments
β€’ use exec form (JSON array).
ENTRYPOINT
ENTRYPOINT ["python", "app.py"]
β€’ Sets the main executable
β€’ not easily overridden, CMD becomes arguments to ENTRYPOINT.
COPY
COPY package*.json ./
β€’ Copies files from build context to image
β€’ preferred over ADD for simple file copying.
ADD
ADD app.tar.gz /app/
β€’ Like COPY but auto-extracts tar archives and supports URLs
β€’ use COPY unless you need extraction.
WORKDIR
WORKDIR /app
β€’ Sets working directory for subsequent instructions
β€’ creates directory if it doesn't exist.
ENV
ENV NODE_ENV=production
β€’ Sets environment variables available at both build and runtime
β€’ persists in running containers.
ARG
ARG VERSION=1.0
β€’ Defines build-time variables
β€’ not available in running containers, used with --build-arg.
EXPOSE
EXPOSE 8080
β€’ Documents which ports the container listens on
β€’ does not publish ports, only metadata.
VOLUME
VOLUME /data
β€’ Creates a mount point for persistent data
β€’ anonymous volume created if not specified at runtime.
USER
USER node
β€’ Sets the user for running subsequent commands and the container
β€’ critical for security, avoid root.
LABEL
LABEL version="1.0"
β€’ Adds metadata as key-value pairs
β€’ queryable with docker inspect, useful for versioning.
HEALTHCHECK
HEALTHCHECK CMD curl -f || exit 1
β€’ Defines how Docker tests if container is healthy
β€’ runs periodically, marks container unhealthy on failure.
STOPSIGNAL
STOPSIGNAL SIGQUIT
β€’ Sets the system call signal sent to stop the container
β€’ default is SIGTERM, useful for apps needing different shutdown signals.
SHELL
SHELL ["/bin/bash", "-c"]
β€’ Overrides the default shell for shell-form commands
β€’ default is ["/bin/sh", "-c"] on Linux, enables bash-specific features.
ONBUILD
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

TechniqueExampleDescription
Multi-stage builds
FROM golang AS builder
FROM alpine
COPY --from=builder /app .
β€’ Uses multiple FROM statements to create separate build stages
β€’ copy only artifacts to final image, drastically reduces size.
Layer caching
COPY package*.json ./
RUN npm install
COPY . .
β€’ Docker caches each layer
β€’ order instructions least to most frequently changed to maximize cache hits.
COPY --link
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.
.dockerignore
node_modules
*.log
.git
β€’ Excludes files from build context
β€’ reduces context size and prevents secrets from being copied.
BuildKit cache mounts
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.
Build secrets
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.
Minimal base images
FROM alpine:3.21
β€’ Use alpine, distroless, or DHI images
β€’ reduce attack surface and image size (alpine ~5MB vs ubuntu ~80MB).
Combining RUN commands
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.
Buildx for multi-platform
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

OptionExampleDescription
-p (publish)
docker run -p 8080:80 nginx
β€’ Maps host port to container port
β€’ format hostPort:containerPort, makes service accessible externally.
-P (publish-all)
docker run -P nginx
β€’ Publishes all EXPOSE'd ports to random high ports on host
β€’ query with docker port.
Specific host IP
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.
Port ranges
docker run -p 8000-8010:8000-8010 app
β€’ Maps a range of ports
β€’ useful for services needing multiple consecutive ports.
UDP ports
docker run -p 53:53/udp dns
β€’ Publishes UDP instead of TCP
β€’ add /udp suffix to port mapping.

Table 7: Network Modes

ModeExampleDescription
bridge (default)
docker run --network bridge nginx
β€’ Creates a virtual network on host
β€’ containers get private IPs, communicate via internal DNS, NAT for external access.
host
docker run --network host nginx
β€’ Container shares host's network stack
β€’ no isolation, container binds to host ports directly, best performance.
none
docker run --network none app
β€’ No networking
β€’ container is completely isolated, useful for batch jobs or maximum security.
overlay
docker network create --driver overlay mynet
β€’ Enables multi-host networking for Swarm
β€’ containers on different hosts communicate as if on same LAN.
macvlan
docker network create -d macvlan mynet
β€’ Assigns MAC address to container
β€’ appears as physical device on network, useful for legacy apps.
ipvlan
docker network create -d ipvlan mynet
β€’ Like macvlan but containers share parent interface's MAC
β€’ avoids MAC address exhaustion.

Table 8: Network Management

CommandExampleDescription
docker network create
docker network create mynet
β€’ Creates a user-defined bridge network
β€’ enables automatic DNS resolution between containers.
docker network ls
docker network ls
Lists all networks with driver type and scope.
docker network connect
docker network connect mynet web
β€’ Connects a running container to an additional network
β€’ containers can be on multiple networks.
docker network disconnect
docker network disconnect mynet web
Removes container from a network while it's running.
docker network inspect
docker network inspect mynet
Shows detailed network configuration including connected containers and IP addresses.
docker network rm
docker network rm mynet
β€’ Removes a network
β€’ fails if containers are connected.
docker network prune
docker network prune
β€’ Removes all unused networks
β€’ confirms before deletion.
host.docker.internal
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

TypeExampleDescription
Named volumes
docker run -v data:/app/data nginx
β€’ Docker-managed volumes stored in /var/lib/docker/volumes/
β€’ preferred for production, portable across hosts.
--mount syntax
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.
Bind mounts
docker run -v /host/path:/container/path nginx
β€’ Maps a host directory to container
β€’ changes sync in real-time, ideal for development.
tmpfs mounts
docker run --tmpfs /tmp nginx
β€’ Stores data in host memory
β€’ not persisted to disk, ultra-fast, useful for caches and temporary files.
Anonymous volumes
docker run -v /app/data nginx
β€’ Created automatically with random name
β€’ hard to manage, removed with container unless --rm is not used.
Read-only volumes
docker run -v data:/app:ro nginx
β€’ Mounts volume as read-only
β€’ container cannot modify host files, improves security.
volumes-from
docker run --volumes-from web nginx
β€’ Shares all volumes from another container
β€’ useful for backup containers.

Table 10: Volume Commands

CommandExampleDescription
docker volume create
docker volume create mydata
β€’ Creates a named volume before using it
β€’ can specify driver and options.
docker volume ls
docker volume ls
Lists all volumes with driver and mount point.
docker volume inspect
docker volume inspect mydata
Shows volume metadata including mountpoint on host filesystem.
docker volume rm
docker volume rm mydata
β€’ Removes a volume
β€’ fails if in use by any container.
docker volume prune
docker volume prune
β€’ Deletes all unused volumes
β€’ dangerous in production, confirms before deletion.

Table 11: Resource Constraints

FlagExampleDescription
--memory (-m)
docker run -m 512m nginx
β€’ Limits container memory
β€’ container killed if exceeded (OOM), suffix: b k m g.
--memory-reservation
docker run --memory-reservation 256m nginx
β€’ Soft limit
β€’ Docker tries to enforce when host memory is low, container can exceed it.
--cpus
docker run --cpus 1.5 nginx
β€’ Limits container to 1.5 CPU cores
β€’ can be fractional (0.5 = 50% of one core).
--cpu-shares
docker run --cpu-shares 512 nginx
β€’ Sets relative weight for CPU time
β€’ default 1024, container with 2048 gets 2x CPU time.
--cpuset-cpus
docker run --cpuset-cpus 0,1 nginx
β€’ Pins container to specific CPU cores
β€’ useful for NUMA systems and performance-critical apps.
--pids-limit
docker run --pids-limit 100 nginx
β€’ Limits number of PIDs (processes/threads)
β€’ prevents fork bombs.
--blkio-weight
docker run --blkio-weight 500 nginx
β€’ Sets disk I/O priority
β€’ default 500, range 10-1000.
--gpus
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

PolicyExampleDescription
no (default)
docker run --restart no nginx
β€’ Never restart container automatically
β€’ manual restart required.
on-failure
docker run --restart on-failure:3 nginx
β€’ Restarts only if container exits with non-zero code
β€’ optional max retry count.
always
docker run --restart always nginx
β€’ Always restarts container, even after host reboot
β€’ use for critical services.
unless-stopped
docker run --restart unless-stopped nginx
β€’ Like always but respects manual stops
β€’ doesn't restart if explicitly stopped before reboot.

Table 13: Health Checks

OptionExampleDescription
HEALTHCHECK instruction
HEALTHCHECK --interval=30s CMD curl -f http://localhost/
|| exit 1
β€’ Defines in Dockerfile how to test if container is healthy
β€’ runs periodically.
--health-cmd
docker run --health-cmd "curl -f http://localhost/"
β€’ Runtime override of HEALTHCHECK
β€’ useful for testing without rebuilding image.
--health-interval
docker run --health-interval=10s nginx
β€’ Time between health checks
β€’ default 30s.
--health-timeout
docker run --health-timeout=5s nginx
β€’ How long to wait for check to complete
β€’ default 30s, fails if exceeded.
--health-retries
docker run --health-retries=3 nginx
β€’ Number of consecutive failures before marking unhealthy
β€’ default 3.
--health-start-period
docker run --health-start-period=60s nginx
β€’ Grace period before starting checks
β€’ allows slow apps to initialize, default 0s.

Table 14: Docker Compose Services

AttributeExampleDescription
image
image: nginx:alpine
β€’ Specifies the image to use
β€’ pulled from registry if not local.
build
build:
context: .
dockerfile: Dockerfile.prod
β€’ Builds image from Dockerfile
β€’ context is build directory, dockerfile is optional custom name.
ports
ports:
- "8080:80"
β€’ Publishes ports
β€’ short syntax "host:container" or long syntax with protocol.
volumes
volumes:
- ./data:/data:ro
β€’ Mounts volumes or bind mounts
β€’ supports short and long syntax with options.
environment
environment:
NODE_ENV: production
β€’ Sets environment variables
β€’ also supports array syntax and .env files.
depends_on
depends_on:
db:
condition: service_healthy
β€’ Defines startup order and conditions
β€’ service_healthy waits for health checks.
networks
networks:
- frontend
β€’ Connects service to custom networks
β€’ enables network isolation.
restart
restart: unless-stopped
β€’ Sets restart policy
β€’ options: no, always, on-failure, unless-stopped.
command
command: npm run dev
β€’ Overrides default CMD from image
β€’ shell or exec form.
entrypoint
entrypoint: /app/entrypoint.sh
β€’ Overrides ENTRYPOINT from image
β€’ rarely needed.
healthcheck
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 30s
β€’ Defines a health check in Compose
β€’ supports test, interval, timeout, retries, start_period.
deploy
deploy:
resources:
limits:
memory: 512M
β€’ Configures deployment and resource constraints
β€’ works in Compose for resource limits and GPU reservations.

Table 15: Docker Compose Commands

CommandExampleDescription
docker compose up
docker compose up -d
β€’ Creates and starts all services
β€’ -d runs detached, rebuilds if Dockerfile changed.
docker compose down
docker compose down -v
β€’ Stops and removes containers, networks
β€’ -v also removes volumes, dangerous in production.
docker compose ps
docker compose ps
Lists containers for this Compose project only.
docker compose logs
docker compose logs -f web
β€’ Shows logs from services
β€’ -f follows, specify service name to filter.
docker compose exec
docker compose exec web sh
β€’ Runs command in a running service
β€’ defaults to first container if replicated.
docker compose build
docker compose build --no-cache
β€’ Builds or rebuilds services
β€’ --no-cache forces full rebuild.
docker compose pull
docker compose pull
Pulls latest images for all services from registry.
docker compose restart
docker compose restart web
Restarts running services without recreating containers.
docker compose stop
docker compose stop
β€’ Stops services without removing containers
β€’ faster than down.
docker compose start
docker compose start
β€’ Starts stopped services
β€’ doesn't create new containers.
docker compose run
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
docker compose watch
β€’ Watches for file changes and auto-updates running services
β€’ actions: sync, rebuild, sync+restart.

Table 16: Docker Compose Advanced Features

FeatureExampleDescription
profiles
profiles: [debug]
β€’ Groups services for selective activation
β€’ docker compose --profile debug up only starts debug services.
extends
extends:
file: common.yml
service: base
β€’ Inherits configuration from another service
β€’ enables reusable base definitions.
override files
docker-compose.override.yml
β€’ Automatically merged with docker-compose.yml
β€’ environment-specific overrides without modifying base file.
include
include:
- monitoring.yml
β€’ Includes separate Compose files
β€’ combines multiple projects into one.
env_file
env_file:
- .env.prod
β€’ Loads environment variables from files
β€’ keeps secrets out of Compose file.
secrets
secrets:
- db_password
β€’ Injects secrets as files in container
β€’ mounted at /run/secrets/.
configs
configs:
- nginx.conf
β€’ Like secrets but for non-sensitive config files
β€’ also mounted as files.
develop (watch)
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).
YAML anchors
x-common: &common
restart: always
services:
web:
<<: *common
β€’ Reuses config blocks with anchors and aliases
β€’ x- prefix defines extension fields that Compose ignores.
GPU support
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

CommandExampleDescription
docker login
docker login registry.example.com
β€’ Authenticates to a registry
β€’ stores credentials in ~/.docker/config.json.
docker logout
docker logout
Removes stored credentials for default registry or specified one.
Username/password login
docker login -u user -p pass
β€’ Non-interactive login
β€’ avoid in scripts, use stdin or token instead.
Token authentication
echo $TOKEN | docker login -u user --password-stdin
β€’ Passes password via stdin
β€’ more secure than command-line password.

Table 18: Image Tagging Strategies

StrategyExampleDescription
Semantic versioning
myapp:1.2.3
β€’ Uses major.minor.patch format
β€’ best practice for release tracking and rollbacks.
Git commit SHA
myapp:a3f2c1b
β€’ Tags with Git commit hash
β€’ enables exact source code traceability.
Environment tags
myapp:prod-1.2.3
β€’ Includes environment prefix
β€’ clearly indicates deployment target.
Date-based tags
myapp:2026-03-01
β€’ Timestamps with YYYY-MM-DD
β€’ useful for nightly builds or time-based releases.
Branch tags
myapp:feature-auth
β€’ Tags with branch name
β€’ tracks feature development images.

Table 19: Cleanup and Maintenance

CommandExampleDescription
docker system prune
docker system prune -a
β€’ Removes stopped containers, unused networks, dangling images
β€’ -a removes all unused images.
docker image prune
docker image prune -a --filter "until=168h"
β€’ Removes unused images
β€’ --filter "until=168h" keeps images created in last 7 days.
docker container prune
docker container prune
β€’ Removes all stopped containers
β€’ confirms before deletion.
docker volume prune
docker volume prune
β€’ Deletes unused volumes
β€’ extremely dangerous in production, back up first.
docker network prune
docker network prune
β€’ Removes unused networks
β€’ safe operation.
docker builder prune
docker builder prune
β€’ Clears BuildKit cache
β€’ frees disk space from layer caching.

Table 20: Logging Drivers

DriverExampleDescription
json-file (default)
--log-driver json-file
β€’ Stores logs as JSON on disk
β€’ queryable with docker logs, limited rotation.
local
--log-driver local
β€’ Optimized local file driver with automatic log rotation
β€’ better performance than json-file.
syslog
--log-driver syslog --log-opt syslog-address=udp://host:514
β€’ Forwards logs to syslog daemon
β€’ integrates with centralized logging.
journald
--log-driver journald
β€’ Sends logs to systemd journal
β€’ query with journalctl.
fluentd
--log-driver fluentd --log-opt fluentd-address=host:24224
β€’ Forwards to Fluentd collector
β€’ popular for Kubernetes and centralized logging.
awslogs
--log-driver awslogs --log-opt awslogs-group=myapp
β€’ Sends logs to AWS CloudWatch Logs
β€’ requires AWS credentials.
gcplogs
--log-driver gcplogs
β€’ Forwards to Google Cloud Logging
β€’ auto-detects GCP metadata.
splunk
--log-driver splunk --log-opt splunk-token=XXX
β€’ Sends logs to Splunk HTTP Event Collector
β€’ enterprise logging solution.

Table 21: Security Practices

PracticeExampleDescription
Run as non-root user
USER node
β€’ Creates and switches to non-root user
β€’ prevents privilege escalation attacks.
Read-only root filesystem
docker run --read-only nginx
β€’ Makes container filesystem immutable
β€’ prevents tampering, use tmpfs for writable dirs.
Drop capabilities
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.
Use secrets
RUN --mount=type=secret,id=token
β€’ Never hardcode secrets in images
β€’ use BuildKit secrets or runtime secrets.
Scan images
docker scout cves nginx:latest
β€’ Scans for vulnerabilities
β€’ integrates with Docker Scout, Trivy, Snyk.
Minimal base images
FROM gcr.io/distroless/static
β€’ Use distroless or alpine
β€’ fewer packages = smaller attack surface.
No privileged mode
Avoid --privileged
β€’ Never use in production
β€’ gives full host access, defeats containerization.
Security profiles
--security-opt seccomp=profile.json
β€’ Apply seccomp/AppArmor/SELinux profiles
β€’ restricts syscalls and actions.
Rootless mode
dockerd-rootless-setuptool.sh install
β€’ Runs Docker daemon without root privileges
β€’ mitigates potential vulnerabilities in daemon and container runtime.
--no-new-privileges
docker run --security-opt no-new-privileges nginx
β€’ Prevents processes from gaining additional privileges via setuid/setgid
β€’ critical for defense in depth.
Docker Hardened Images (DHI)
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

SignalExampleDescription
SIGTERM
Sent by docker stop
β€’ Graceful shutdown signal
β€’ application should clean up resources and exit within grace period (default 10s).
SIGKILL
Sent after grace period
β€’ Force kill signal
β€’ cannot be caught or ignored, immediate termination.
SIGINT
Ctrl+C in attached mode
β€’ Interrupt signal
β€’ often handled same as SIGTERM by applications.
SIGHUP
docker kill -s SIGHUP web
β€’ Hangup signal
β€’ commonly used to reload configuration without restart.
Exec form vs shell form
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

CommandExampleDescription
docker context create
docker context create remote --docker "host=ssh://user@host"
β€’ Creates a remote Docker context
β€’ enables managing remote Docker daemons.
docker context use
docker context use remote
β€’ Switches active context
β€’ all docker commands target this daemon.
docker context ls
docker context ls
Lists all contexts with current one marked by *.
docker context rm
docker context rm remote
β€’ Removes a context
β€’ cannot remove active context.
DOCKER_HOST variable
export DOCKER_HOST=ssh://user@host
β€’ Sets remote daemon via environment variable
β€’ alternative to contexts.

Table 24: Docker Swarm Basics

CommandExampleDescription
docker swarm init
docker swarm init
β€’ Initializes a Swarm cluster
β€’ current node becomes manager.
docker swarm join
docker swarm join --token TOKEN host:2377
Joins a node to existing Swarm as worker or manager.
docker service create
docker service create --replicas 3 nginx
Creates a Swarm service with replicas across cluster.
docker service scale
docker service scale web=5
Scales service to specified number of replicas.
docker service update
docker service update --image nginx:1.21 web
β€’ Rolling update of service
β€’ updates containers one by one.
docker node ls
docker node ls
Lists all nodes in Swarm with status and availability.
docker stack deploy
docker stack deploy -c compose.yml myapp
β€’ Deploys a Compose file to Swarm
β€’ creates all services, networks, volumes.

Table 25: Environment Variables

MethodExampleDescription
-e flag
docker run -e NODE_ENV=prod nginx
β€’ Sets single variable
β€’ most direct method, visible in docker inspect.
--env-file
docker run --env-file .env nginx
β€’ Loads variables from file
β€’ one VAR=value per line, comments with #.
ENV in Dockerfile
ENV NODE_ENV=production
β€’ Bakes variables into image
β€’ persists in all containers, bad for secrets.
ARG in Dockerfile
ARG VERSION=1.0
β€’ Build-time only variables
β€’ passed with --build-arg, not in final image.
Compose environment
environment:
NODE_ENV: prod
β€’ Sets variables in Compose file
β€’ applies to that service only.
Compose env_file
env_file: .env
β€’ Loads variables from file in Compose
β€’ supports multiple files.

Table 26: Inspect and Debug

CommandExampleDescription
docker inspect
docker inspect --format '{{.State.Status}}' web
β€’ Shows raw JSON config
β€’ use --format with Go templates to extract specific fields.
docker events
docker events --filter type=container
β€’ Live stream of daemon events
β€’ shows create, start, stop, die, etc.
docker system df
docker system df -v
β€’ Shows disk usage by images, containers, volumes
β€’ -v for detailed breakdown.
docker system info
docker system info
Displays system-wide information including storage driver, kernel version, containers count.
docker version
docker version
Shows client and server versions with API version and Go version.
docker debug
docker debug web
β€’ Launches a debug shell attached to container's namespaces
β€’ requires Docker Desktop; works even on containers without a shell.
docker init
docker init
β€’ Generates Dockerfile, compose.yaml, .dockerignore for a project
β€’ supports Go, Node, Python, Rust, Java, PHP, ASP.NET templates.

Table 27: Copy Operations

CommandExampleDescription
docker cp (container to host)
docker cp web:/app/log.txt ./log.txt
β€’ Copies file from container to host
β€’ works on running and stopped containers.
docker cp (host to container)
docker cp ./config.yml web:/app/config.yml
β€’ Copies file from host to container
β€’ immediately available in running container.
Copy directories
docker cp web:/app/logs ./logs
Recursively copies entire directories.
Archive mode
docker cp -a web:/app ./backup
β€’ Preserves UID/GID and permissions
β€’ equivalent to cp -a.

Table 28: BuildKit Advanced Features

FeatureExampleDescription
Cache mounts
RUN --mount=type=cache,target=/root/.cache/pip
pip install -r requirements.txt
β€’ Persists package manager cache across builds
β€’ dramatically speeds up dependency installs.
SSH mounts
RUN --mount=type=ssh git clone git@github.com:repo
β€’ Forwards SSH agent into build
β€’ enables private Git repos without storing keys.
Bind mounts
RUN --mount=type=bind,source=.,target=/src
make build
β€’ Mounts files into build without COPY
β€’ doesn't add to image layers.
External cache
docker build --cache-from type=registry,ref=myapp:cache
β€’ Uses remote cache from registry
β€’ enables cache sharing across CI runners.
Inline cache
docker build --cache-to type=inline
β€’ Embeds cache metadata in image
β€’ simplest cache sharing method.
SBOM attestation
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.
Provenance attestation
docker buildx build --provenance=mode=max -t myapp .
β€’ Records SLSA-compliant build provenance
β€’ cryptographically proves what commit, CI runner, and inputs produced the image.
Buildx bake
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

CommandExampleDescription
docker scout cves
docker scout cves nginx:latest
β€’ Scans an image for CVEs
β€’ shows severity, CVSS score, affected package, and fix availability.
docker scout quickview
docker scout quickview nginx:latest
β€’ Displays a summary of vulnerabilities and policy compliance
β€’ fast overview without printing the full CVE list.
docker scout recommendations
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
docker scout sbom nginx:latest
β€’ Generates a Software Bill of Materials
β€’ lists all packages, versions, and licenses found in the image.
docker scout compare
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
docker scout enroll myorg
β€’ Enrolls an organization in Docker Scout
β€’ enables policy enforcement, repository integration, and team dashboards.

Table 30: Docker Model Runner

CommandExampleDescription
docker model pull
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
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
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
docker model list
Lists all locally downloaded AI models with size and status.
docker model rm
docker model rm ai/llama3.2
Removes a downloaded model from local storage.
OpenAI-compatible API
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

FeatureExampleDescription
Create cloud builder
docker buildx create --driver cloud myorg/mybuilder
β€’ Creates a remote cloud-based builder
β€’ builds run in Docker's infrastructure, not on the local machine.
Build with cloud
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.
Set as default builder
docker buildx use cloud-myorg/mybuilder
Sets the cloud builder as default for all subsequent docker buildx build commands.
List builders
docker buildx ls
Lists all available builders including cloud builders and their status.
Shared build cache
(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

ConditionExampleDescription
service_started
depends_on:
db:
condition: service_started
β€’ Waits for service to be started
β€’ doesn't guarantee it's ready, default behavior.
service_healthy
depends_on:
db:
condition: service_healthy
β€’ Waits for health check to pass
β€’ requires HEALTHCHECK in image or Compose.
service_completed_successfully
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

ImageExampleDescription
Alpine Linux
FROM alpine:3.21
β€’ Lightweight 5MB base
β€’ uses musl libc, may have compatibility issues with compiled binaries.
Distroless
FROM gcr.io/distroless/static-debian12
β€’ No shell, no package manager
β€’ only runtime dependencies, ultimate security and size reduction.
Scratch
FROM scratch
β€’ Empty base image
β€’ use for static binaries only (Go, Rust), absolute minimal size.
Distroless with shell (debug)
FROM gcr.io/distroless/base-debian12:debug
β€’ Adds busybox shell to distroless
β€’ only for debugging, never production.
Docker Hardened Images (DHI)
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.
Back to Containers Orchestration
Next Topic: Docker Compose Cheat Sheet

References

Official Documentation

  1. Docker Documentation β€” https://docs.docker.com/
  2. Docker Reference Documentation β€” https://docs.docker.com/reference/
  3. Dockerfile Reference β€” https://docs.docker.com/reference/dockerfile/
  4. Docker Compose Reference β€” https://docs.docker.com/reference/compose-file/
  5. Docker CLI Reference β€” https://docs.docker.com/reference/cli/docker/
  6. Docker Engine API β€” https://docs.docker.com/reference/api/engine/
  7. Docker Build Reference β€” https://docs.docker.com/build/
  8. Docker BuildKit Documentation β€” https://docs.docker.com/build/buildkit/
  9. Docker Networking Overview β€” https://docs.docker.com/engine/network/
  10. Docker Storage Documentation β€” https://docs.docker.com/engine/storage/
  11. Docker Security Documentation β€” https://docs.docker.com/engine/security/
  12. Docker Swarm Documentation β€” https://docs.docker.com/engine/swarm/
  13. Docker Registry Documentation β€” https://docs.docker.com/registry/
  14. Docker Hub Documentation β€” https://docs.docker.com/docker-hub/
  15. Docker Desktop Documentation β€” https://docs.docker.com/desktop/
  16. Docker Extensions Documentation β€” https://docs.docker.com/extensions/
  17. Docker Scout Documentation β€” https://docs.docker.com/scout/

Technical Blogs & Tutorials

  1. 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
  2. Top 55+ Basic Docker Commands You Must Learn in 2026 β€” https://www.knowledgehut.com/blog/devops/basic-docker-commands
  3. Docker Commands Explained: From Beginner to Production-Ready β€” https://aws.plainenglish.io/docker-commands-explained-from-beginner-to-production-ready-in-one-guide-eb8235f1f4b2
  4. 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
  5. 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
  6. 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
  7. 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
  8. Docker Learning Roadmap: Beginner to Expert (2026) β€” https://www.coursera.org/resources/docker-learning-roadmap

Building Best Practices

  1. Building Best Practices β€” Docker Docs β€” https://docs.docker.com/build/building/best-practices/
  2. Top 20 Dockerfile Best Practices β€” Sysdig β€” https://www.sysdig.com/learn-cloud-native/dockerfile-best-practices
  3. Dockerfile Performance Optimization: Best Practices Explained β€” https://medium.com/@vasanthancomrads/dockerfile-performance-optimization-best-practices-explained-25d85877f12b
  4. Best Practices and Tips for Writing a Dockerfile β€” Qovery β€” https://www.qovery.com/blog/best-practices-and-tips-for-writing-a-dockerfile
  5. Docker Best Practices 2026 [Updated] β€” Thinksys Inc. β€” https://thinksys.com/devops/docker-best-practices/
  6. 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/
  7. Docker Best Practices: Choosing Between RUN, CMD, and ENTRYPOINT β€” https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/
  8. 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/
  9. 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
  10. 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

  1. Multi-stage Builds β€” Docker Docs β€” https://docs.docker.com/build/building/multi-stage/
  2. How to Optimize Docker Images with Multi-Stage Builds β€” https://oneuptime.com/blog/post/2026-02-20-docker-multi-stage-builds/view
  3. 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
  4. 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
  5. Understanding Multi-Stage Docker Builds β€” Blacksmith β€” https://www.blacksmith.sh/blog/understanding-multi-stage-docker-builds
  6. 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

  1. Optimize Cache Usage in Builds β€” Docker Docs β€” https://docs.docker.com/build/cache/optimize/
  2. Advanced Docker BuildKit Optimization Techniques β€” https://medium.com/@vasanthancomrads/advanced-docker-buildkit-optimization-techniques-b469552b831e
  3. How to Optimize Docker Build Times with Layer Caching β€” https://oneuptime.com/blog/post/2026-01-16-docker-optimize-build-times/view
  4. How to Use Docker BuildKit Cache Mounts and Secrets β€” https://oneuptime.com/blog/post/2026-01-16-docker-buildkit-cache-secrets/view
  5. Docker BuildKit Deep Dive: Optimize Your Build Performance β€” https://tech.sparkfabrik.com/en/blog/docker-cache-deep-dive/
  6. 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
  7. The Ultimate Guide to Docker Build Cache β€” Depot β€” https://depot.dev/blog/ultimate-guide-to-docker-build-cache
  8. Docker Layer Caching in CI Pipelines Cut Build Times by 70 β€” https://www.netdata.cloud/academy/docker-layer-caching/
  9. Faster CI Builds with Docker Layer Caching and BuildKit β€” https://testdriven.io/blog/faster-ci-builds-with-docker-cache/
  10. 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/
  11. 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

  1. Container Security in 2026: 7 Key Components, Risks & Defenses β€” https://checkmarx.com/learn/container-security/container-security-in-2026-7-key-components-risks-defenses/
  2. Container Security Best Practices: An Enterprise Guide for 2026 β€” https://www.ox.security/blog/container-security-best-practices/
  3. 10 Container Security Best Practices for Enterprises in 2026 β€” https://www.portainer.io/blog/container-security-best-practices
  4. How to Handle Docker Security Best Practices β€” https://oneuptime.com/blog/post/2026-02-02-docker-security-best-practices/view
  5. 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
  6. Docker Security Best Practices | Sonatype Guide β€” https://www.sonatype.com/resources/guides/docker-security-best-practices
  7. 10 Docker Image Security Best Practices β€” Snyk β€” https://snyk.io/blog/10-docker-image-security-best-practices/
  8. 12 Container Image Scanning Best Practices β€” Sysdig β€” https://www.sysdig.com/learn-cloud-native/12-container-image-scanning-best-practices
  9. Docker Security β€” OWASP Cheat Sheet Series β€” https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html
  10. Container Security: Best Practices for Docker and Kubernetes Environments β€” https://www.codecademy.com/article/container-security-best-practices-for-docker-and-kubernetes-environments
  11. Docker Container Security Best Practices for Modern Applications β€” https://www.wiz.io/academy/container-security/docker-container-security-best-practices

Networking

  1. Networking β€” Docker Docs β€” https://docs.docker.com/engine/network/
  2. Port Publishing and Mapping β€” Docker Docs β€” https://docs.docker.com/engine/network/port-publishing/
  3. How to Implement Docker Container Networking Modes β€” https://oneuptime.com/blog/post/2026-01-30-docker-container-networking-modes/view
  4. Advanced Docker Networking β€” https://medium.com/@Adekola_Olawale/advanced-docker-networking-85eef5b915f4
  5. Docker Networking Advanced: Custom Networks and Bridge Modes β€” https://dohost.us/index.php/2025/07/29/docker-networking-advanced-custom-networks-and-bridge-modes/
  6. Docker Networking Best Practices: A Beginner-to-Advanced Guide β€” https://whatsinthecloud.substack.com/p/docker-networking-best-practices
  7. Mastering Docker Network Modes: Bridge, Host, and None β€” https://www.linkedin.com/pulse/mastering-docker-network-modes-bridge-host-none-beginners-akash-gupta-xizzf
  8. How to Map Docker Ports Correctly (Host, Bridge, and Container Modes) β€” https://oneuptime.com/blog/post/2026-01-16-docker-port-mapping/view
  9. 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
  10. Docker Desktop Networking Features (host.docker.internal) β€” https://docs.docker.com/desktop/features/networking/

Storage & Volumes

  1. Volumes β€” Docker Docs β€” https://docs.docker.com/engine/storage/volumes/
  2. Bind Mounts β€” Docker Docs β€” https://docs.docker.com/engine/storage/bind-mounts/
  3. tmpfs Mounts β€” Docker Docs β€” https://docs.docker.com/engine/storage/tmpfs/
  4. How to Use Docker tmpfs Mounts for Faster I/O β€” https://oneuptime.com/blog/post/2026-01-16-docker-tmpfs-mounts/view
  5. 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
  6. Docker Mount Types: Volumes, Bind Mounts & tmpfs Guide β€” https://www.datacamp.com/tutorial/docker-mount
  7. 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

  1. Docker Compose β€” Docker Docs β€” https://docs.docker.com/compose/
  2. Services | Docker Docs β€” https://docs.docker.com/reference/compose-file/services/
  3. How to Configure Docker Compose for Development β€” https://oneuptime.com/blog/post/2026-02-02-docker-compose-development/view
  4. How to Build Docker Compose for Local Development β€” https://oneuptime.com/blog/post/2026-01-30-docker-compose-local-development/view
  5. Docker Compose: Complete Guide with Practical Examples β€” https://cubepath.com/docs/docker-kubernetes/docker-compose-complete-guide-with-examples
  6. Control Startup and Shutdown Order in Compose β€” https://docs.docker.com/compose/how-tos/startup-order/
  7. How to Wait for Container Dependencies in Docker Compose β€” https://oneuptime.com/blog/post/2026-01-25-wait-for-container-dependencies-docker-compose/view
  8. How to Use Docker Compose Depends On β€” https://oneuptime.com/blog/post/2026-01-25-docker-compose-depends-on/view
  9. 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
  10. Use Service Profiles β€” Docker Docs β€” https://docs.docker.com/compose/how-tos/profiles/
  11. Use Multiple Compose Files β€” Docker Docs β€” https://docs.docker.com/compose/how-tos/multiple-compose-files/
  12. How to Use Docker Compose Extends for Reusable Configurations β€” https://oneuptime.com/blog/post/2026-01-16-docker-compose-extends/view
  13. How to Set Up Docker Compose Override Files β€” https://oneuptime.com/blog/post/2026-01-25-docker-compose-override-files/view
  14. 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

  1. Resource Constraints β€” Docker Docs β€” https://docs.docker.com/engine/containers/resource_constraints/
  2. Docker CPU & Memory Limits: Prevent Container Crashes β€” https://oneuptime.com/blog/post/2026-01-16-docker-limit-cpu-memory/view
  3. How to Implement Docker Container Resource Limits β€” https://oneuptime.com/blog/post/2026-01-30-docker-container-resource-limits/view
  4. Runtime Metrics β€” Docker Docs β€” https://docs.docker.com/engine/containers/runmetrics/
  5. How to Monitor Docker Container Resource Usage in Real Time β€” https://oneuptime.com/blog/post/2026-01-16-docker-monitor-resource-usage/view
  6. Advanced Container Resource Monitoring with docker stats β€” https://last9.io/blog/container-resource-monitoring-with-docker-stats/
  7. 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

  1. Configure Logging Drivers β€” Docker Docs β€” https://docs.docker.com/engine/logging/configure/
  2. Logs and Metrics β€” Docker Docs β€” https://docs.docker.com/engine/logging/
  3. How to Implement Docker Logging Best Practices β€” https://oneuptime.com/blog/post/2026-01-30-docker-logging-best-practices/view
  4. How to Set Up Docker Container Logging Drivers β€” https://oneuptime.com/blog/post/2026-01-25-docker-container-logging-drivers/view
  5. Mastering Docker Logs: A Comprehensive Tutorial β€” Dash0 β€” https://www.dash0.com/guides/mastering-docker-logs
  6. 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/
  7. Guide to Docker Logs and How to See Them β€” New Relic β€” https://newrelic.com/blog/infrastructure-monitoring/docker-logs

Registry & Authentication

  1. Docker Login β€” Docker Docs β€” https://docs.docker.com/reference/cli/docker/login/
  2. Registry Authentication β€” Docker Docs β€” https://docs.docker.com/reference/api/registry/auth/
  3. How to Set Up Docker Registry Authentication β€” https://oneuptime.com/blog/post/2026-01-22-docker-registry-authentication/view
  4. Private Registry Authentication in Amazon ECR β€” https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
  5. Push and Pull Images | Artifact Registry | Google Cloud β€” https://docs.cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling

Health Checks & Restart Policies

  1. Start Containers Automatically β€” Docker Docs β€” https://docs.docker.com/engine/containers/start-containers-automatically/
  2. Understanding Docker Restart Policies: always, unless-stopped, on-failure β€” https://oneuptime.com/blog/post/2026-01-16-docker-restart-policies/view
  3. Docker Restart Policies: A Complete Guide to Container Resilience β€” https://infosecwriteups.com/docker-restart-policies-a-complete-guide-to-container-resilience-3be33be0bfef
  4. Docker Health Check: A Practical Guide β€” Dash0 β€” https://www.dash0.com/guides/docker-health-check-a-practical-guide
  5. 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

  1. How to Handle Docker Container Graceful Shutdown and Signal Handling β€” https://oneuptime.com/blog/post/2026-01-16-docker-graceful-shutdown-signals/view
  2. How to Set Up Docker Container Signal Handling β€” https://oneuptime.com/blog/post/2026-01-25-docker-container-signal-handling/view
  3. 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/
  4. Trapping Signals in Docker Containers β€” CloudBees β€” https://www.cloudbees.com/blog/trapping-signals-in-docker-containers
  5. Are You Gracefully Shutting Down Your Containers? β€” https://www.sls.guru/blog/are-you-gracefully-shutting-down-your-containers
  6. 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

  1. Multi-platform Builds β€” Docker Docs β€” https://docs.docker.com/build/building/multi-platform/
  2. How to Use Docker Multi-Platform Builds β€” https://oneuptime.com/blog/post/2026-02-02-docker-multi-platform/view
  3. How to Rapidly Build Multi-Architecture Images with Buildx β€” https://www.docker.com/blog/how-to-rapidly-build-multi-architecture-images-with-buildx/
  4. How to Implement Multi-Architecture Image Building with Docker Buildx β€” https://oneuptime.com/blog/post/2026-02-09-multi-arch-docker-buildx/view
  5. Docker buildx for Multi-Platform Image Builds β€” https://www.anantacloud.com/post/docker-buildx-for-multi-platform-image-builds-a-practical-guide

Cleanup & Maintenance

  1. Prune Unused Docker Objects β€” Docker Docs β€” https://docs.docker.com/engine/manage-resources/pruning/
  2. 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
  3. 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
  4. How To Remove Docker Images, Containers, and Volumes β€” https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes
  5. Tidy Up with docker system prune β€” Depot β€” https://depot.dev/blog/docker-system-prune

User Permissions & Security

  1. Linux Post-Installation Steps for Docker Engine β€” https://docs.docker.com/engine/install/linux-postinstall/
  2. How to Set Up Docker Container User Permissions β€” https://oneuptime.com/blog/post/2026-01-25-docker-container-user-permissions/view
  3. How to Run Docker Containers as Non-Root Users β€” https://oneuptime.com/blog/post/2026-01-16-docker-run-non-root-user/view
  4. Understanding the Docker USER Instruction β€” https://www.docker.com/blog/understanding-the-docker-user-instruction/
  5. 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
  6. Rootless Mode β€” Docker Docs β€” https://docs.docker.com/engine/security/rootless/

Environment Variables

  1. Build Variables β€” Docker Docs β€” https://docs.docker.com/build/building/variables/
  2. How to Pass Build Arguments and Environment Variables in Docker β€” https://oneuptime.com/blog/post/2026-01-06-docker-build-args-env-variables/view
  3. How to Use Docker Environment Variables β€” https://oneuptime.com/blog/post/2026-01-23-docker-environment-variables/view
  4. 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
  5. Set Environment Variables β€” Docker Docs β€” https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/
  6. Setting Docker Environment Variables: The Ultimate Guide β€” https://configu.com/blog/docker-environment-variables-arg-env-using-them-correctly/

Image Management & Tagging

  1. How to Handle Docker Image Tagging β€” https://oneuptime.com/blog/post/2026-02-02-docker-image-tagging/view
  2. How to Name, Version, and Reference Container Images β€” https://developers.redhat.com/articles/2025/01/28/how-name-version-and-reference-container-images
  3. Docker Image Tag β€” Docker Docs β€” https://docs.docker.com/reference/cli/docker/image/tag/
  4. Docker Image Naming and Tagging β€” DEV Community β€” https://dev.to/kalkwst/docker-image-naming-and-tagging-1pg9

Inspection & Debugging

  1. 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
  2. How to Debug Docker Build Context and Layer Caching Issues β€” https://oneuptime.com/blog/post/2026-01-16-docker-debug-build-context-cache/view
  3. Understanding the Image Layers β€” Docker Docs β€” https://docs.docker.com/get-started/docker-concepts/building-images/understanding-image-layers/

Docker Init & Debug

  1. Docker Init β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/init/
  2. Docker Debug β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/debug/
  3. 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

  1. Use Compose Watch β€” Docker Docs β€” https://docs.docker.com/compose/how-tos/file-watch/
  2. Docker Compose Run β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/compose/run/
  3. Docker Compose Watch β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/compose/watch/
  4. GPU Support in Docker Compose β€” Docker Docs β€” https://docs.docker.com/compose/how-tos/gpu-support/
  5. Compose File Fragments (YAML Anchors) β€” Docker Docs β€” https://docs.docker.com/reference/compose-file/fragments/
  6. Compose Deploy Specification β€” Docker Docs β€” https://docs.docker.com/reference/compose-file/deploy/
  7. Compose Healthcheck β€” Docker Docs β€” https://docs.docker.com/reference/compose-file/services/#healthcheck

Container Management CLIs

  1. Docker Container Rename β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/container/rename/
  2. Docker Container Update β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/container/update/
  3. Docker Container Commit β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/container/commit/
  4. Docker Search β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/search/

Dockerfile Advanced Instructions

  1. STOPSIGNAL β€” Dockerfile Reference β€” https://docs.docker.com/reference/dockerfile/#stopsignal
  2. SHELL β€” Dockerfile Reference β€” https://docs.docker.com/reference/dockerfile/#shell
  3. ONBUILD β€” Dockerfile Reference β€” https://docs.docker.com/reference/dockerfile/#onbuild
  4. Understand How CMD and ENTRYPOINT Interact β€” Docker Docs β€” https://docs.docker.com/reference/dockerfile/#understand-how-cmd-and-entrypoint-interact
  5. COPY --link β€” Dockerfile Reference β€” https://docs.docker.com/reference/dockerfile/#copy---link

BuildKit Advanced & Bake

  1. Docker Buildx Bake β€” Docker Docs β€” https://docs.docker.com/build/bake/
  2. Bake File Reference β€” Docker Docs β€” https://docs.docker.com/build/bake/reference/
  3. Cache Storage Backends β€” Docker Docs β€” https://docs.docker.com/build/cache/backends/
  4. SBOM Attestations β€” Docker Docs β€” https://docs.docker.com/build/metadata/attestations/sbom/
  5. SLSA Provenance Attestations β€” Docker Docs β€” https://docs.docker.com/build/metadata/attestations/slsa-provenance/

Security Advanced

  1. Rootless Mode β€” Docker Docs β€” https://docs.docker.com/engine/security/rootless/
  2. Docker Scout CVEs β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/scout/cves/
  3. Docker Scout Quickview β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/scout/quickview/
  4. Docker Scout Recommendations β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/scout/recommendations/
  5. Docker Scout SBOM β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/scout/sbom/
  6. Docker Scout Compare β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/scout/compare/
  7. Docker Scout Enroll β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/scout/enroll/
  8. SecComp Security Profiles for Docker β€” Docker Docs β€” https://docs.docker.com/engine/security/seccomp/
  9. AppArmor Security Profiles for Docker β€” Docker Docs β€” https://docs.docker.com/engine/security/apparmor/
  10. Docker Hardened Images β€” Docker β€” https://www.docker.com/products/hardened-images/

Docker Swarm & Orchestration

  1. Docker Swarm Overview β€” Docker Docs β€” https://docs.docker.com/engine/swarm/
  2. Docker Service Create β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/service/create/
  3. Docker Stack Deploy β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/stack/deploy/
  4. Portainer Advisory: Docker Swarm β€” https://www.portainer.io/blog/portainer-technical-advisory-docker-swarm

Distroless & Minimal Images

  1. GoogleContainerTools Distroless β€” GitHub β€” https://github.com/GoogleContainerTools/distroless
  2. Why Distroless Container Images β€” Google Cloud Blog β€” https://cloud.google.com/blog/products/containers-kubernetes/distroless-container-images-improve-security
  3. Alpine Linux Docker Image β€” Docker Hub β€” https://hub.docker.com/_/alpine
  4. Alpine Linux Release Branches β€” https://alpinelinux.org/releases/

Docker Model Runner & AI

  1. Docker Model Runner Overview β€” Docker Docs β€” https://docs.docker.com/ai/model-runner/
  2. Docker Model Runner API Reference β€” Docker Docs β€” https://docs.docker.com/ai/model-runner/api-reference/
  3. Docker Model Run β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/model/run/
  4. Docker Model Pull β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/model/pull/
  5. Docker Model List β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/model/ls/
  6. Docker Model Rm β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/model/rm/
  7. 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/
  8. How We Designed Docker Model Runner and What's Next β€” https://www.docker.com/blog/how-we-designed-model-runner-and-whats-next/
  9. Docker Model Runner Cheatsheet 2025 β€” DEV Community β€” https://dev.to/ajeetraina/docker-model-runner-cheatsheet-2025-37nd
  10. Docker Model Runner: Simplifying Local LLM Model Execution β€” https://securityboulevard.com/2025/12/docker-model-runner-simplifying-local-llm-model-execution/
  11. Docker MCP Catalog and Toolkit β€” Docker Blog β€” https://www.docker.com/blog/docker-mcp-catalog-and-toolkit/

Docker Build Cloud

  1. Docker Build Cloud β€” Docker Docs β€” https://docs.docker.com/build-cloud/
  2. Docker Build Cloud Setup β€” Docker Docs β€” https://docs.docker.com/build-cloud/setup/
  3. Docker Buildx Create β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/buildx/create/
  4. Docker Buildx Use β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/buildx/use/
  5. Docker Buildx Ls β€” CLI Reference β€” https://docs.docker.com/reference/cli/docker/buildx/ls/

Additional 2026 Resources

  1. Docker in 2026: Current State and What's Changed β€” https://www.docker.com/blog/docker-2025-2026-year-in-review/
  2. Container Security in 2026: Enterprise Strategies β€” https://www.wiz.io/academy/container-security/docker-container-security-best-practices
  3. Docker Desktop Features Overview β€” https://docs.docker.com/desktop/features/
  4. Docker Daemon Configuration (daemon.json) β€” https://docs.docker.com/reference/cli/dockerd/#daemon-configuration-file

More in Containers Orchestration

  • Container Storage and Persistent Volumes Cheat Sheet
  • Docker Compose Cheat Sheet
  • CaaS (Containers as a Service) Cheat Sheet
  • Container Lifecycle Management Cheat Sheet
  • Container Orchestration Patterns Cheat Sheet
  • Dockerfile Cheat Sheet
View all 19 topics in Containers Orchestration