3.2. Creating logically bound images
You can create logically bound images by using a Podman Quadlet .image or .container files.
Prerequisites
-
The
container-toolsmeta-package is installed.
Procedure
- Select the image that you want to logically bound.
Create a
Containerfile:$ cat Containerfile FROM quay.io/<namespace>/<image>:latest COPY ./<app_1>.image /usr/share/containers/systemd/<app_1>.image COPY ./<app_2>.container /usr/share/containers/systemd/<app_2>.container RUN ln -s /usr/share/containers/systemd/<app_1>.image \ /usr/lib/bootc/bound-images.d/<app_1>.image && \ ln -s /usr/share/containers/systemd/<app_2>.container \ /usr/lib/bootc/bound-images.d/<app_2>.containerIn the
.containerdefinition, use:GlobalArgs=--storage-opt=additionalimagestore=/usr/lib/bootc/storageIn the
Containerfileexample, the image is selected to be logically bound by creating a symlink in the/usr/lib/bootc/bound-images.ddirectory pointing to either an.imageor a.containerfile.Run the
bootc upgradecommand.$ bootc upgradeThe bootc upgrade performs the following overall steps:
- Fetches the new base image from the image repository. See Configuring container pull secrets.
- Reads the new base image root file system to discover logically bound images.
-
Automatically pulls any discovered logically bound images defined in the new bootc image into the bootc-owned
/usr/lib/bootc/storageimage storage.
Make the bound images become available to container runtimes such as Podman. For that, you must explicitly configure bound images to point to the bootc storage as an "additional image store". For example:
podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage run <image>
Do not attempt to globally enable the /usr/lib/bootc/storage image storage in /etc/containers/storage.conf. Only use the bootc storage for logically bound images.
The bootc image store is owned by bootc. The logically bound images will be garbage collected when they are no longer referenced by a file in the /usr/lib/bootc/bound-images.d directory.