Bundle files into a container image and push it with no build tool at all using crane append, then adjust entrypoint/env/labels with crane mutate.

domain: github.com/google/go-containerregistry · 8 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Append a tarball as a new layer on a base image and push in one step: `crane append -f layer.tar -t ${IMAGE} -b ${BASE_IMAGE}`. Omitting -b produces an image from only the appended layer(s); -f can be repeated. `--oci-empty-base` uses OCI media types for the empty base; `--set-base-image-annotations` records base-image provenance annotations. Docs: cmd/crane/doc/crane_append.md
  2. Bundle a directory on the fly with process substitution: `crane append -f <(tar -f - -c some-dir/) -t ${IMAGE}` (from cmd/crane/recipes.md).
  3. `crane append` prints the pushed image reference, so it chains into mutate: `crane mutate $(crane append -f <(tar -f - -c some-dir/) -t ${IMAGE}) --entrypoint=some-dir/entrypoint.sh`.
  4. Mutate config fields of a pushed image (crane pulls, updates, re-pushes): `crane mutate IMAGE --entrypoint=/app/start.sh --cmd=arg1,arg2 --env KEY=value --label maintainer=me --annotation key=value --user 1000 --workdir /app --exposed-ports 8080`. Multiple -e/--env and -l/--label pairs are supported. Docs: cmd/crane/doc/crane_mutate.md
  5. Control the mutate destination: `-t/--tag NEW_TAG` tags in the original repo; `--repo OTHER_REPO` pushes by digest to a different repository; with neither, it pushes by digest back to the source repo. `-o/--output PATH` writes a local tarball instead of pushing. `--append PATH` can add another layer during the same mutate.
  6. Push a pre-built local image: `crane push PATH IMAGE` — PATH is an OCI layout directory or a `docker save`-style tarball; add `--index` for multi-image layouts; `--image-refs PATH` writes the published reference to a file (cmd/crane/doc/crane_push.md).
  7. Pull for offline inspection/editing: `crane pull IMAGE out.tar [--format tarball|legacy|oci]`, then re-push later with `crane push`.
  8. Inspect an image's filesystem without running it: `crane export IMAGE - | tar -tvf -` to list files, or `crane export IMAGE - | tar -Oxf - path/to/file` (no leading slash) to extract one file (cmd/crane/doc/crane_export.md, recipes.md).

Known gotchas

Related routes

Assemble a container image with buildah's scripted commands (no Dockerfile): buildah from scratch or a base image, then run, copy, config, and commit.
github.com/containers/buildah · 9 steps · unrated
Copy or promote a container image between registries daemonless, using crane or skopeo
github.com/google/go-containerregistry · 10 steps · unrated
Create a minimal devcontainer.json using a prebuilt base image plus Dev Container Features (ghcr.io/devcontainers/features) to add tools without a custom Dockerfile
containers.dev/implementors/json_reference · 7 steps · unrated

Give your agent this knowledge — and 17,300+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans