Use it to run containers with Docker, or when the Docker daemon or a container misbehaves.
Docker
Docker is a container engine: dockerd manages images, containers, networks and volumes through containerd and runc, controlled with the docker CLI.
1. systemctl status docker — daemon running?
2. docker info — storage driver, root dir, warnings.
3. docker ps -a and docker logs <c>.
4. Disk: docker system df.
5. Firewall: iptables -S DOCKER-USER.
docker CLI → dockerd → containerd → runc starts the container
For Containers → Docker, continue with the first unproven Topic check: Pin exact host, runtime/hypervisor, object identity, source revision/image/definition and failing workload. If that boundary is healthy, advance to the adjacent check: Read back effective runtime state including process, namespace/resource or virtual-hardware boundaries. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
docker inspect web | lessVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
Docker client/API → daemon → image/config → runtime/containerd/runc → kernel namespaces/cgroups → mounts/network → process → workload
Healthy evidence: daemon and runtime agree on the intended object and the container reaches expected process, mount, network and workload state
Step 2 Verification and output interpretation Verify boundary
Verification chain. Docker client/API → daemon → image/config → runtime/containerd/runc → kernel namespaces/cgroups → mounts/network → process → workload
Step 3 Specialized verification Verify boundary
Inspect container ID/image, state/health, namespace/network attachments, mounts and effective configuration. Correlate the host-side process/cgroup with the container and test the application inside its namespace before testing published access from outside. For storage, show whether data is in the writable layer, named volume or bind path. After recreate/update, verify data persistence and original client flow. A healthy daemon and running container are only infrastructure-layer evidence.
Step 4 Commands Verify boundary
docker run -d --name web -p 8080:80 nginx:1.27
docker exec -it web sh
docker inspect web | less
Step 5 Failure modes and next checks Narrow the fault
Suspicious evidence: Docker reports success while stale/wrong image, restart loop, mount, network or application readiness remains wrong
Step 6 Special cases and limits Narrow the fault
Container localhost is not host localhost, and published ports can still be blocked by bind address, host firewall or application listener. Sharing the host kernel means kernel/module constraints are host-wide. Deleting a container can destroy writable-layer data even though the image remains. Image presence does not show the running container uses it. Keep daemon, container lifecycle, namespaces/mounts and application readiness separate.
Step 7 Common mistakes Narrow the fault
- Publishing ports on all interfaces when only localhost is needed.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
The docker group grants root-equivalent access. Docker publishes ports with its own iptables rules that can bypass host firewalls (use the DOCKER-USER chain). Clean up with docker system prune carefully.
docker ps -a / podman ps -a— containers and statedocker logs <c>— container outputdocker inspect <c>— configuration, mounts, networkdocker info— engine, storage driver, cgroup version
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
Docker command success shows an accepted operation only; close the boundary at effective container state and workload behavior.
In depth
Running containers with Docker
Docker runs containers from images and manages their life cycle. The Docker documentation on running containers covers the main options of docker run:
-druns in the background, and--namegives a fixed name.-esets environment variables (a bare name copies the host's value).--memorysets a hard memory limit (minimum 6M), and--cpusa fractional CPU limit.--useroverrides the image's user, which defaults to root.- Exit code 125 means an error in the Docker daemon itself, 126 that the command couldn't be invoked, and 127 that it couldn't be found. Any other code is the container command's own exit status.
Options used on servers
| Option | Purpose |
|---|---|
--restart unless-stopped | Start again after a crash or reboot, unless stopped by hand |
--memory 512m --cpus 1.5 | Limits, so one container can't starve the host |
--user 1000:1000 | Don't run as root inside the container |
--read-only --tmpfs /tmp | An immutable root file system |
--cap-drop ALL --cap-add NET_BIND_SERVICE | Only the capabilities needed |
--security-opt no-new-privileges | Block privilege escalation through setuid binaries |
-p 127.0.0.1:8080:8080 | Publish only locally (behind a reverse proxy) |
--log-opt max-size=10m --log-opt max-file=3 | Limit json-file log growth |
Everyday commands
| Task | Command |
|---|---|
| Running containers | docker ps |
| Logs | docker logs -f --since 10m web1 |
| A shell inside | docker exec -it web1 sh |
| Resource use | docker stats --no-stream |
| Details (network, mounts, restart count) | docker inspect web1 |
| Stop and remove | docker stop web1 && docker rm web1 |
host$ docker run -d --name report-api --restart unless-stopped \
--memory 512m --cpus 1.5 --user 1000:1000 --read-only --tmpfs /tmp \
--cap-drop ALL --security-opt no-new-privileges \
-p 127.0.0.1:8080:8080 -e LOG_LEVEL=info \
--log-opt max-size=10m --log-opt max-file=3 \
registry.example.net/report-api:1.4.2
host$ docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
NAMES STATUS PORTS
report-api Up 12 seconds 127.0.0.1:8080->8080/tcp
host$ docker stats --no-stream report-api
host$ docker inspect -f '{{.State.ExitCode}} {{.State.OOMKilled}} {{.RestartCount}}' report-api
0 false 0
Diagnosing restarts
If a container keeps restarting, docker inspect shows its last exit code, whether it was OOM-killed, and the restart count. 137 together with OOMKilled true means the memory limit is too low, or the application leaks. Other codes come from the application itself, and its logs explain them.
Documented example, not captured output.
How it works at runtime
Docker is part of Containers → Docker. Docker on Linux coordinates images, containers, networks, volumes and daemon/API state, while the effective result is still Linux process, mount, namespace and cgroup state.
Docker/libvirt add lifecycle, image/disk, network and volume abstractions above those primitives.
Topic-specific state model. Docker on Linux coordinates images, containers, networks, volumes and daemon/API state, while the effective result is still Linux process, mount, namespace and cgroup state.
Specialized mechanics
Docker Engine manages images, container writable layers, namespaces, cgroups, networks and volumes through the daemon/container runtime. A container is a process set sharing the host kernel, not a miniature VM. Image configuration is immutable input while container runtime state and writable layer are separate; volumes/bind mounts introduce host-backed persistence. Container “running” only states lifecycle, not that the application inside is ready. Restart policy, health status and daemon recovery are separate states; a restarted container can retain its writable layer while receiving a new process identity.
Quick reference
Docker architecture: the docker CLI talks to dockerd over /var/run/docker.sock; dockerd uses containerd and runc. Access to the socket equals root on the host.
docker info
docker ps -a; docker logs -f --tail 100 web
docker exec -it web sh
docker inspect web --format '{{.State.Status}} {{.RestartCount}} {{.HostConfig.RestartPolicy.Name}}'
docker system df; docker system prune
/etc/docker/daemon.json # log-driver, log-opts, data-root, registry mirrors
Set log rotation ("log-opts": {"max-size": "10m", "max-file": "3"}) — default json-file logs grow without limit. Rootless Docker/Podman reduce the host risk.
Limits and how it fails
Primary failure point. Docker command success shows an accepted operation only; close the boundary at effective container state and workload behavior.
Snapshot/image existence is not a verified backup.
ReferenceConfiguration & state2 sections · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Docker owns Docker engine lifecycle and object semantics; Linux kernel isolation and application health remain separate things to check.
Specialized lifecycle
Keep desired state in Dockerfiles/Compose/orchestration and use explicit volumes or bind mounts for data that must persist. Define published ports, network attachment, user identity, capabilities and resource limits deliberately. Avoid editing files inside a running container as the durable configuration model when the instance is meant to be recreated. For bind mounts, account for host ownership and SELinux labels. Pin images by controlled tags/digests where reproducibility matters and plan image updates separately from data migration.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Containers → Docker. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.docker.com/engine/ · confidence 94%Authoritative Linux project/vendor documentation reviewed for bounded reference claims: container lifecycle, image/runtime separation and daemon-owned state. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.
Basis: https://docs.docker.com/engine/ · confidence 93%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Docker operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Docker.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Docker on Linux coordinates images, containers, networks, volumes and daemon/API state, while the effective result is still Linux process, mount, namespace and cgroup state. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin host + object identity + source image/definition → verify host/runtime capability → read back effective process/namespace/cgroup or virtual-hardware state → verify storage/network attachments → verify guest/container readiness → repeat original workload + regression check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | Docker client/API → daemon → image/config → runtime/containerd/runc → kernel namespaces/cgroups → mounts/network → process → workload | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Docker command success proves an accepted operation only; close the boundary at effective container state and workload behavior. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux container/virtualization evidence can establish this proof path: Docker client/API → daemon → image/config → runtime/containerd/runc → kernel namespaces/cgroups → mounts/network → process → workload | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved clients, names, identities, routes, sessions, backends or time periods. Docker command success proves an accepted operation only; close the boundary at effective container state and workload behavior. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven runtime boundary, capture adjacent host/object/resource/attachment evidence, make only the demonstrated persistent change, then repeat the original workload plus a regression check. | Continue to the next unresolved boundary while preserving the original test condition. |
Docker · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Docker |
|---|---|
| Topic path | Containers → Docker |
| Runtime state | Docker on Linux coordinates images, containers, networks, volumes and daemon/API state, while the effective result is still Linux process, mount, namespace and cgroup state. |
| Fast checks | - Pin exact host, runtime/hypervisor, object identity, source revision/image/definition and failing workload. - Read back effective runtime state including process, namespace/resource or virtual-hardware boundaries. - Trace storage and network attachments plus readiness from the real client or dependent workload path. - Apply the smallest persistent change, then repeat the original workload and an adjacent regression check. |
| Verification chain | Docker client/API → daemon → image/config → runtime/containerd/runc → kernel namespaces/cgroups → mounts/network → process → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | Docker command success proves an accepted operation only; close the boundary at effective container state and workload behavior. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |
Docker · specialized operational reference
Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.
| Operational boundary | Topic-specific reference |
|---|---|
| Identity | container ID + image digest/tag + runtime state |
| Persistence | writable layer vs volume vs bind mount |
| Network | container netns + published host path |
| Proof | Inside readiness + external original client transaction |