From 5f6ac8210c324357b8ededf53b52e6fb77891563 Mon Sep 17 00:00:00 2001 From: Gianluca Zuccarelli Date: Fri, 1 Mar 2024 14:51:49 +0000 Subject: [PATCH] bib: document local containers --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 087447688..44e81e160 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,33 @@ sudo podman run \ quay.io/centos-bootc/fedora-bootc:eln ``` +### Using local containers + +To use containers from local container's storage rather than a registry, we need to ensure two things: +- the container exists in local storage +- mount the local container storage + +Since the container is run in `rootful` only root container storage paths are allowed. + +```bash +sudo podman run \ + --rm \ + -it \ + --privileged \ + --pull=newer \ + --security-opt label=type:unconfined_t \ + -v $(pwd)/config.json:/config.json \ + -v $(pwd)/output:/output \ + -v /var/lib/containers/storage:/var/lib/containers/storage \ + quay.io/centos-bootc/bootc-image-builder:latest \ + --type qcow2 \ + --config /config.json \ + -- local \ + localhost/bootc:eln +``` + +Note we need to pass the `--local` flag, we need to mount the storage path as a volume and then use the name of the local container. + ### Running the resulting QCOW2 file on Linux (x86_64) A virtual machine can be launched using `qemu-system-x86_64` or with `virt-install` as shown below.