crane & oras: Copying Images & Artifacts
Two small command-line tools cover most registry work in a supply-chain pipeline, without a Docker daemon:
| Tool | From | Best at |
|---|---|---|
| crane | Google's go-containerregistry | images: copy, tag, inspect, append layers, mutate configs, export file systems |
| oras | the ORAS project (CNCF) | any artifact: push files (SBOMs, Helm charts, WASM modules, policy bundles) to a registry, attach them to images, discover what's attached |
Both talk to localhost:5000 over plain HTTP here. crane allows HTTP for localhost automatically; oras needs --plain-http. Against a real registry, both use your Docker credentials (~/.docker/config.json) or their own login commands.
Promoting an image without changing it
A common release flow builds once into a staging repository, tests, then promotes the exact same digest to production. crane copy copies manifests and blobs byte for byte, so the digest, and every signature attached to it, stays valid:
crane push /opt/samples/images/alpine-3.18.0.tar localhost:5000/staging/app:build-42 > /dev/null 2>&1
crane copy localhost:5000/staging/app:build-42 localhost:5000/prod/app:1.4.2 2>&1 | grep -v 'mounted blob' # blob lines arrive in parallel
crane tag localhost:5000/prod/app:1.4.2 stable
echo "staging: $(crane digest localhost:5000/staging/app:build-42)"
echo "prod: $(crane digest localhost:5000/prod/app:1.4.2)"
crane ls localhost:5000/prod/app
crane catalog localhost:50002026/10/23 21:57:03 Copying from localhost:5000/staging/app:build-42 to localhost:5000/prod/app:1.4.2
2026/10/23 21:57:03 localhost:5000/prod/app:1.4.2: digest: sha256:f04ffda0b1406b530a735ae8676c9d6fa527618e842cc66b1bc09ae4dbd44e0b size: 428
2026/10/23 21:57:03 localhost:5000/prod/app:stable: digest: sha256:f04ffda0b1406b530a735ae8676c9d6fa527618e842cc66b1bc09ae4dbd44e0b size: 428
staging: sha256:f04ffda0b1406b530a735ae8676c9d6fa527618e842cc66b1bc09ae4dbd44e0b
prod: sha256:f04ffda0b1406b530a735ae8676c9d6fa527618e842cc66b1bc09ae4dbd44e0b
1.4.2
stable
prod/app
staging/app
crane copy mounted the blobs (it prints a mounted blob line for each, filtered out here because they arrive in parallel, in no fixed order; a cross-repository mount means the registry links existing blobs instead of receiving them again), then wrote the same manifest. crane tag adds a second tag to the same digest without downloading anything. Rebuilding for production instead of promoting would produce a new digest, and you'd have to scan, sign and attest it all over again.
Exporting and inspecting
crane push /opt/samples/images/alpine-3.18.0.tar localhost:5000/demo/alpine:3.18.0 > /dev/null 2>&1
crane export localhost:5000/demo/alpine:3.18.0 - | tar -tf - | grep -c .
crane export localhost:5000/demo/alpine:3.18.0 - | tar -xOf - etc/alpine-release
crane export localhost:5000/demo/alpine:3.18.0 - | tar -xOf - lib/apk/db/installed | grep -A1 '^P:busybox