From 081a518fffb351db125bb72d91466150a7426568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Fri, 26 Jan 2024 11:16:51 +0100 Subject: [PATCH] docs: Add generic container image configuration support See: https://github.com/coreos/rpm-ostree/pull/4703 See: https://github.com/ostreedev/ostree-rs-ext/pull/567 See: https://github.com/opencontainers/image-spec/blob/main/config.md Fixes: https://github.com/coreos/rpm-ostree/issues/4712 --- docs/container.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/container.md b/docs/container.md index d80b9ccec4..9396c0d7bc 100644 --- a/docs/container.md +++ b/docs/container.md @@ -157,6 +157,40 @@ for historical reasons. $ rpm-ostree compose image --initialize-mode=if-not-exists --format=registry workstation-ostree-config/fedora-silverblue.yaml quay.io/example/exampleos:latest ``` +## Adding container image configuration + +By default, the `rpm-ostree compose image` command creates container images +with a minimal config. It notably does not include a default command or +entrypoint. + +To add more configuration to the created OCI images, you can pass an image +configuration JSON document via the `--image-config=` argument. + +Example image configuration JSON (`config.json`): + +``` +{ + "Env": [ + "FOO=BAR", + ], + "Cmd": [ + "/bin/bash" + ], + "Labels": { + "license": "MIT", + } +} +``` + +Example `rpm-ostree compose image` command: + +``` +rpm-ostree compose image --initialize --format=ociarchive --image-config=config.json manifest.yaml image.ociarchive +``` + +You can find the reference for the image configuration JSON format in the +[OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/main/config.md). + ## Converting OSTree commits to new base images The ostree-container model creates a bidirectional bridge between ostree and OCI