Use it to pull, build, tag or inspect images, or when a container runs an unexpected version.
Images
A container image is a stack of read-only layers plus configuration (entrypoint, env, ports), identified by name:tag and an immutable digest, stored in registries.
1. docker image ls — tag and ID.
2. Digest: docker image inspect <img> --format '{{.RepoDigests}}'.
3. Which image does the container run? docker inspect <c> --format '{{.Image}}'.
4. Pull failing → registry auth/proxy/DNS.
5. Scan: trivy image <img>.
Dockerfile → build → layers → tag/digest → pushed → pulled → container
For Containers → Images, 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.
Verification & 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
registry/local store → tag/digest resolution → manifest/platform → layers → config/entrypoint → container rootfs → process
Healthy evidence: the expected digest/platform/layers/config are selected and produce the intended runtime filesystem and entrypoint
Step 2 Verification and output interpretation Verify boundary
Verification chain. registry/local store → tag/digest resolution → manifest/platform → layers → config/entrypoint → container rootfs → process
Step 3 Commands Verify boundary
docker pull nginx:1.27
docker image ls
docker image inspect nginx:1.27 --format '{{.Id}}'
docker image prune
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: a familiar tag points to another digest, wrong architecture is selected, cached layers hide change, or runtime overrides image config
Image identity is confirmed by digest/platform and effective config, not by a mutable tag alone.
Step 5 Common mistakes Narrow the fault
latesttags in production.
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.
Tags such as latest move; pin by digest for reproducibility. Scan images for vulnerabilities (trivy, docker scout). Keep images small and rebuild for security updates.
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 & boundaries5 sections · depth on demand
What this shows and what it does not
Image identity is confirmed by digest/platform and effective config, not by a mutable tag alone.
In depth
Building good container images
A good image is small, reproducible, rebuilt regularly and doesn't run as root. Docker's build best practices recommend:
- Multi-stage builds, so that only what's needed at runtime ends up in the final image.
- A minimal base image, because fewer packages mean fewer vulnerabilities.
- Pinning the base image to a digest, so a republished tag can't silently change builds (with tools such as Dependabot to keep the pins current).
- A
.dockerignorefile. - Combining
apt-get updatewithapt-get installin oneRUN. - A non-root
USER, with explicit UIDs and GIDs. - One concern per container.
- Frequent rebuilds with
--pull, so base image updates are picked up.
A multi-stage Dockerfile
host$ cat Dockerfile
# syntax=docker/dockerfile:1
FROM python:3.12-slim@sha256:<digest> AS build
WORKDIR /src
COPY requirements.txt .
RUN pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt
FROM python:3.12-slim@sha256:<digest>
RUN groupadd -g 10001 app && useradd -u 10001 -g app -s /usr/sbin/nologin app
WORKDIR /app
COPY --from=build /wheels /wheels
RUN pip install --no-cache-dir /wheels/* && rm -rf /wheels
COPY --chown=app:app src/ ./
USER 10001:10001
EXPOSE 8080
ENTRYPOINT ["python", "-m", "report_api"]
host$ cat .dockerignore
.git
__pycache__
tests/
*.env
host$ docker build --pull -t registry.example.net/report-api:1.4.2 .
host$ docker image ls registry.example.net/report-api
host$ docker push registry.example.net/report-api:1.4.2
Why each line is there
| Element | Reason |
|---|---|
| Build stage with wheels | Compilers and build tools stay out of the final image |
@sha256: digest | The exact same base image every time |
| A fixed UID 10001 | Predictable file ownership on volumes; not root |
.dockerignore | No Git history or secrets in the build context |
Exec-form ENTRYPOINT | The program is PID 1 and receives signals directly |
Tags and digests
Tags like latest, or even 1.4, can be moved to another image. Deployments that must be reproducible should reference images by digest, or by an immutable version tag. Scanning images (Trivy, Grype, or the registry's own scanner) before deployment catches known vulnerabilities in packages.
Documented example, not captured output.
How it works at runtime
Images is part of Containers → Images. Container Images are immutable-style content/config templates addressed by tags or digests and expanded into a runnable root filesystem plus metadata.
Topic-specific state model. Container Images are immutable-style content/config templates addressed by tags or digests and expanded into a runnable root filesystem plus metadata.
Quick reference
Images are layered: each Dockerfile instruction that changes files creates a layer; layers are shared between images. Identify images by digest for reproducibility.
docker pull nginx:1.27
docker image inspect nginx:1.27 --format '{{index .RepoDigests 0}}'
docker history nginx:1.27
docker build -t app:1.4.2 .
docker buildx build --platform linux/amd64,linux/arm64 -t registry.example.com/app:1.4.2 --push .
trivy image app:1.4.2 # vulnerability scan
Good images: small base (distroless/alpine/ubi-minimal), multi-stage builds, non-root USER, no secrets in layers (they remain in history), pinned versions.
Limits and how it fails
Primary failure point. Image identity is confirmed by digest/platform and effective config, not by a mutable tag alone.
Snapshot/image existence is not a verified backup.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Images owns image identity and composition; build pipelines and registry security belong to Automation/Security where applicable.
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 → Images. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.docker.com/engine/ · confidence 94%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
Images operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Images.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Container Images are immutable-style content/config templates addressed by tags or digests and expanded into a runnable root filesystem plus metadata. | 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 | registry/local store → tag/digest resolution → manifest/platform → layers → config/entrypoint → container rootfs → process | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Image identity is proven by digest/platform and effective config, not by a mutable tag alone. | 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: registry/local store → tag/digest resolution → manifest/platform → layers → config/entrypoint → container rootfs → process | 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. Image identity is proven by digest/platform and effective config, not by a mutable tag alone. | 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. |
Images · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Images |
|---|---|
| Topic path | Containers → Images |
| Runtime state | Container Images are immutable-style content/config templates addressed by tags or digests and expanded into a runnable root filesystem plus metadata. |
| 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 | registry/local store → tag/digest resolution → manifest/platform → layers → config/entrypoint → container rootfs → process Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | Image identity is proven by digest/platform and effective config, not by a mutable tag alone. 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. |