A container image looks like one file when you pull it, but on the wire it’s a small graph of JSON documents pointing at compressed tarballs, each addressed by SHA-256. Understanding that graph is the difference between guessing why an image won’t pull on arm64 and reading the manifest index to see exactly which platforms it supports. It’s also the foundation for image signing, SBOM attachments, and registry mirroring.
How to verify
Inspect an image from any OCI-compliant registry without pulling its layers:
# Modern: skopeo (no daemon required)
skopeo inspect docker://docker.io/library/nginx:latest
skopeo inspect --raw docker://docker.io/library/nginx:latest | jq .
# Docker / containerd flavor
docker manifest inspect nginx:latest
docker buildx imagetools inspect nginx:latest --raw
# Local image
docker save nginx:latest -o /tmp/nginx.tar
tar -tf /tmp/nginx.tar | head
The --raw flag is the important one — it shows the actual JSON object as the registry returned it, including the mediaType that tells you whether you’re looking at a single-arch manifest or a multi-arch index.
What’s happening
The OCI image format is three kinds of object:
- Image manifest — the list of layers, the config blob digest, and metadata. One manifest per platform.
- Image config — a JSON document describing the image’s environment, entrypoint, exposed ports, layer history, and the rootfs diff IDs.
- Image index (or “manifest list” in Docker terminology) — a list of manifests, each annotated with
platform.architectureandplatform.os. This is hownginx:latestresolves to different layers depending on whether you’re pulling from arm64 or amd64.
Every object is content-addressed. The manifest references the config by sha256:..., the config references each layer’s diff ID by sha256:..., and the index references each per-platform manifest by sha256:.... Change any byte and every dependent digest changes — which is the whole basis for image signing.
Layers are tarballs, optionally compressed (gzip historically, zstd in newer registries). A layer is not a complete filesystem; it’s a diff from the previous layer, including special whiteout files (.wh.<name>) to mark deletions. The runtime stacks all the layers using overlayfs (or another snapshotter) to materialize the rootfs.
The image config tells the runtime which user to run as, which command to exec, which env vars to set, and the labels attached to the image. It also carries the history array — a record of every layer with the build command that produced it. docker history reads this.
The procedure
- Walk an image’s full graph by hand. Start at the index, follow to the per-platform manifest, then to the config:
# 1. The top-level descriptor — an index for multi-arch images
skopeo inspect --raw docker://nginx:latest | jq '.manifests[] | {platform: .platform, digest: .digest}'
# 2. Fetch the amd64-specific manifest
DIGEST=$(skopeo inspect --raw docker://nginx:latest | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
skopeo inspect --raw docker://nginx@$DIGEST
# 3. Fetch the image config (referenced by the manifest)
CONFIG_DIGEST=$(skopeo inspect --raw docker://nginx@$DIGEST | jq -r .config.digest)
skopeo inspect --config docker://nginx@$DIGEST | jq .
That third step shows you the actual Env, Entrypoint, Cmd, User, WorkingDir, and the layered build history.
- Dump a local image as a tarball and explore its OCI structure on disk:
mkdir -p /tmp/oci-out
skopeo copy docker://nginx:latest oci:/tmp/oci-out:nginx-latest
ls /tmp/oci-out/
# index.json oci-layout blobs/sha256/
cat /tmp/oci-out/index.json | jq .
cat /tmp/oci-out/blobs/sha256/<config-digest> | jq .
This is the OCI image layout — the canonical on-disk format. Every registry mirror, every signing tool, and every air-gapped transfer ultimately uses this layout.
- Build a multi-arch image with buildx and inspect the resulting index:
docker buildx create --use --name multiarch
docker buildx build --platform linux/amd64,linux/arm64 \
-t registry.example.com/myapp:1.0 --push .
docker buildx imagetools inspect registry.example.com/myapp:1.0
Buildx pushes one index pointing at two manifests, one per architecture. When an arm64 host pulls :1.0, the registry picks the arm64 manifest based on the client’s Accept header.
- Diagnose “no matching manifest” errors. The message means the index doesn’t include your platform:
# What does the client send for platform?
docker version --format '{{.Server.Os}}/{{.Server.Arch}}'
# What does the image actually support?
docker manifest inspect myapp:1.0 | jq '.manifests[].platform'
If you see amd64 only and your host is arm64, either rebuild for multi-arch or pin to an amd64 base and accept emulation.
- Inspect layer contents without extracting the whole image. Layers are addressable individually:
LAYER=$(skopeo inspect docker://nginx:latest | jq -r '.Layers[0]')
mkdir /tmp/oci && cd /tmp/oci
skopeo copy --src-creds=user:pass docker://nginx:latest oci:./out:latest
zcat blobs/sha256/<layer-digest> | tar -tv | head -20
This is invaluable for “what file is in which layer” debugging — particularly when an image is unexpectedly large and you need to find the bloat.
- Verify an image’s signature with cosign (the de-facto OCI signing tool):
cosign verify --certificate-identity-regexp '.*' \
--certificate-oidc-issuer-regexp '.*' \
ghcr.io/example/myapp:1.0
Signatures and SBOMs are stored as separate OCI artifacts in the same registry, addressed by referrers API. See Docker image security scanning for the broader supply-chain picture.
- Mirror an image into a private registry without re-tagging — preserving the original digest is crucial for signature validity:
skopeo copy --all docker://upstream.example.com/app:1.0 \
docker://registry.internal/app:1.0
The --all flag copies every platform manifest in the index, not just the current platform.
Common pitfalls
- Pulling by tag in production is a moving target. Pin to a digest (
nginx@sha256:abc...) for reproducible deploys — the tag can be re-pointed by the upstream maintainer at any time. docker pullon an older Docker version against an OCI v1.1 manifest may fail with amediaTypemismatch. Either upgrade Docker or push with--type docker/manifest-listto use Docker’s legacy media type.- The
latesttag often points to an index, but:1.21might be a single manifest for amd64 only. Verify withdocker manifest inspectbefore deploying multi-arch. - Layer hashes (
diff_idin the config) are hashes of the uncompressed tarball. The manifest references the compressed blob digest. These are two different digests — don’t confuse them when debugging. - Image config
CmdandEntrypointarrays — modifying one without understanding the other leads to surprising behavior.Entrypointis the actual program;Cmdis the default args.docker run image foooverridesCmd, notEntrypoint.
We standardize on OCI-native tooling (skopeo, cosign, oras) across every registry workflow we operate. The image spec is the contract between build, registry, and runtime — getting fluent with it shortens supply-chain debugging dramatically, and it’s part of the managed operations hygiene we run for every client platform.