Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Docker

Direct answer

Docker is a container engine: dockerd manages images, containers, networks and volumes through containerd and runc, controlled with the docker CLI.

When to use this

Use it to run containers with Docker, or when the Docker daemon or a container misbehaves.

First 30 seconds

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.

Operational verification

docker CLI → dockerd → containerd → runc starts the container

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commanddocker inspect web | less
Scope / prerequisiteUse it to run containers with Docker, or when the Docker daemon or a container misbehaves.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

7 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points

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.

Key checks
  • docker ps -a / podman ps -a — containers and state
  • docker logs <c> — container output
  • docker inspect <c> — configuration, mounts, network
  • docker 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:

  • -d runs in the background, and --name gives a fixed name.
  • -e sets environment variables (a bare name copies the host's value).
  • --memory sets a hard memory limit (minimum 6M), and --cpus a fractional CPU limit.
  • --user overrides 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

OptionPurpose
--restart unless-stoppedStart again after a crash or reboot, unless stopped by hand
--memory 512m --cpus 1.5Limits, so one container can't starve the host
--user 1000:1000Don't run as root inside the container
--read-only --tmpfs /tmpAn immutable root file system
--cap-drop ALL --cap-add NET_BIND_SERVICEOnly the capabilities needed
--security-opt no-new-privilegesBlock privilege escalation through setuid binaries
-p 127.0.0.1:8080:8080Publish only locally (behind a reverse proxy)
--log-opt max-size=10m --log-opt max-file=3Limit json-file log growth

Everyday commands

TaskCommand
Running containersdocker ps
Logsdocker logs -f --since 10m web1
A shell insidedocker exec -it web1 sh
Resource usedocker stats --no-stream
Details (network, mounts, restart count)docker inspect web1
Stop and removedocker 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
2026-09-13 · vendor docDocker Engine current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
docker linuxdocker enginedocker daemon containers
Embedded reference data

Quick lookup tables

Docker operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Docker.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateDocker 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 verificationPin 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 chainDocker client/API → daemon → image/config → runtime/containerd/runc → kernel namespaces/cgroups → mounts/network → process → workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryDocker 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 evidenceCorrelated Linux container/virtualization evidence can establish this proof path: Docker client/API → daemon → image/config → runtime/containerd/runc → kernel namespaces/cgroups → mounts/network → process → workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 boundaryDocker
Topic pathContainers → Docker
Runtime stateDocker 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 chainDocker 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 boundaryDocker 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 ruleProve 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 boundaryTopic-specific reference
Identitycontainer ID + image digest/tag + runtime state
Persistencewritable layer vs volume vs bind mount
Networkcontainer netns + published host path
ProofInside readiness + external original client transaction
Confirmation

Confirm action

Continue?