From fde777adcdaa9cf5e6c4e8dae5675205ba7d040e Mon Sep 17 00:00:00 2001 From: Florian Wilhelm Date: Mon, 2 Dec 2024 11:03:46 +0100 Subject: [PATCH] add usage example --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3a0ef71..85f29e5 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,8 @@ chmod +x unbase_oci ./unbase_oci [options] base_image target_image output_image base_image, target_image, and output_image can either be OCI-archive file names -or container images of the form "${container_engine}:${image}". +or container images of the form "${container_engine}:${image}" where ${container_engine} +might be `podman` or `docker`. For this the images must already be pulled in the local image storage of ${container_engine}. For all but base_image you can use the ":${tag}" shorthand to indicate that the same container engine @@ -68,7 +69,19 @@ Options: ## Example Usage -For instance, consider building a container on top of a Debian base. Let's assume `debian.oci` represents an exported OCI archive of the Debian base image, while `container.oci` is an exported OCI archive of the target image. To create a *bare* variant of the target container, containing only the dependencies of explicitly installed components on top of Debian (e.g.: libc), execute: +For instance, consider building a container on top of a Debian base. +Let's assume you build your container with a `Containerfile` based on the `debian` image. +To create a *bare* variant of the target container, containing only the dependencies of explicitly installed components on top of Debian (e.g.: libc), execute: + +```shell +podman pull debian +podman build -t container . +./unbase_oci --ldd-dependencies podman:debian podman:container:latest podman:container:bare +``` + +After running this command, the image `container:bare` is available in your local podman instance. + +If you work with exported oci archives, the equivalent command is: ```shell ./unbase_oci --ldd-dependencies debian.oci container.oci container_bare.oci