Containerfile: initial version

This commit adds an initial Containerfile to build an `image-builder`
container.

Use all the DNF commands together and add a cleaning command to the end
of it. This makes fewer layers and keeps the image size slightly
smaller.

Co-authored-by: Simon de Vlieger <supakeen@redhat.com>
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit is contained in:
Michael Vogt 2024-12-03 16:49:13 +01:00
parent b3f9fb88f1
commit 5aa75ec1c1
3 changed files with 94 additions and 0 deletions

24
entrypoint.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
set -e
# TODO: share code with bib to do the setup automatically
# see https://github.com/teamsbc/container-for-osbuild/blob/main/entrypoint.bash (thanks simon)
# and https://github.com/osbuild/bootc-image-builder/blob/main/bib/internal/setup/setup.go#L21 (thanks ondrej,achilleas,colin)
mkdir /run/osbuild
mkdir /run/osbuild-store
mount -t tmpfs tmpfs /run/osbuild
mount -t tmpfs tmpfs /run/osbuild-store
cp -p /usr/bin/osbuild /run/osbuild/osbuild
chcon system_u:object_r:root_t:s0 /run/osbuild-store
chcon system_u:object_r:install_exec_t:s0 /run/osbuild/osbuild
mount -t devtmpfs devtmpfs /dev
mount --bind /run/osbuild/osbuild /usr/bin/osbuild
# XXX: make this nicer
cd /output
/usr/bin/image-builder --store=/store "$@"