Skip to content

Commit

Permalink
add usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe committed Dec 2, 2024
1 parent f45b668 commit fde777a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fde777a

Please sign in to comment.