2025-02-21 13:10:22 -05:00
|
|
|
# This test case exercises using the fedora-bootc image as a builder
|
|
|
|
|
# to generate a minimal target image derived from CentOS Stream 10 content,
|
|
|
|
|
# and then further extends it in a secondary phase.
|
2025-02-24 13:53:01 -05:00
|
|
|
FROM quay.io/fedora/fedora-bootc:rawhide as repos
|
2025-02-21 13:10:22 -05:00
|
|
|
|
|
|
|
|
# This is intentionally a locally built image
|
|
|
|
|
FROM localhost/fedora-bootc as builder
|
2025-05-09 15:36:39 -04:00
|
|
|
RUN --mount=type=bind,from=repos,src=/,dst=/repos,rw <<EORUN
|
|
|
|
|
echo -e '--install\nltrace' > args.txt
|
|
|
|
|
/usr/libexec/bootc-base-imagectl --args-file args.txt build-rootfs --manifest=standard/manifest /repos /target-rootfs
|
|
|
|
|
EORUN
|
2025-02-21 13:10:22 -05:00
|
|
|
|
|
|
|
|
# This pulls in the rootfs generated in the previous step
|
|
|
|
|
FROM scratch
|
|
|
|
|
COPY --from=builder /target-rootfs/ /
|
|
|
|
|
RUN <<EORUN
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
. /usr/lib/os-release
|
2025-02-24 13:53:01 -05:00
|
|
|
test "$ID" = fedora
|
2025-02-21 13:10:22 -05:00
|
|
|
|
2025-05-09 15:36:39 -04:00
|
|
|
rpm -q ltrace
|
|
|
|
|
|
2025-02-21 13:10:22 -05:00
|
|
|
# And install a package
|
|
|
|
|
dnf -y install strace
|
|
|
|
|
dnf clean all
|
|
|
|
|
|
|
|
|
|
# Cleanup and lint
|
2025-02-24 13:53:01 -05:00
|
|
|
rm -rf /var/log /var/cache/* /var/lib/dnf
|
2025-02-21 13:10:22 -05:00
|
|
|
bootc container lint
|
|
|
|
|
EORUN
|
|
|
|
|
LABEL containers.bootc 1
|
|
|
|
|
ENV container=oci
|
|
|
|
|
STOPSIGNAL SIGRTMIN+3
|
|
|
|
|
CMD ["/sbin/init"]
|
|
|
|
|
|