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>
24 lines
743 B
Bash
Executable file
24 lines
743 B
Bash
Executable file
#!/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 "$@"
|