Assemble minimal OCI images from declarative package configs with apko
Use apko to build small OCI images from declarative package manifests when supply-chain clarity and minimal contents matter more than a conventional Dockerfile flow.
Prerequisites
apko and access to the package sources and OCI output destination you intend to use
Installation
Use the upstream install or setup path that matches your environment:
- brew install apko
- go install chainguard.dev/apko@latest
- docker run cgr.dev/chainguard/apko version
- docker run -v "$PWD":/work cgr.dev/chainguard/apko build examples/alpine-base.yaml apko-alpine:edge apko-alpine.tar
Requirements and caveats from upstream:
- or, with Docker:
- You can then load the generated tar image into a Docker environment:
Basic usage or getting-started notes:
-
Fully reproducible by default. Run apko twice and you will get exactly the same binary.
-
Services. apko supports using the s6 supervision suite to run multiple processes
-
You can install apko from Homebrew:
-
Extracted from upstream docs: https://raw.githubusercontent.com/chainguard-dev/apko/HEAD/README.md