On this page
Docker Operations Manual
Docker is a Linux container runtime. Core concepts: image (read-only template), container (running instance of an image), volume (persistent storage), network (inter-container communication), compose (multi-container orchestration).
Containers
# List containers
# Run
# Restart policies:
# no: Do not auto-restart (default)
# on-failure[:N]: Restart if exit code is non-zero (optional: max N times)
# unless-stopped: Always restart unless manually stopped (also applies after dockerd restart)
# always: Always restart under any circumstances
# Lifecycle
# Debugging
| |
# Commit current container state as a new image (for debugging, not standard deployment)
Images
# Transfer between machines (without registry)
# Use case: When a machine behind a firewall cannot pull from Docker Hub, save on a machine that can, scp, then load
# View image layers
|
Docker Compose
Networks
# Custom bridge network (recommended: containers can access each other by name)
# → Built-in DNS: container names automatically resolve to IPs
# Default bridge does not have this feature; only IP-based access is possible
Volumes
Cleanup
# One-click cleanup of all unused resources (use with caution!)
# -a: includes unused images
# --volumes: includes unused volumes
# Check disk usage
Troubleshooting
# Container keeps restarting
|
# DNS resolution fails inside container
# → Check dockerd startup parameter --dns
# → Check host /etc/docker/daemon.json: { "dns": ["8.8.8.8"] }
# Port conflict
|
# docker.sock permissions