@@ -15,14 +15,10 @@ COPY . /src
1515FROM scratch as packaging
1616COPY contrib/packaging /
1717
18- FROM $base as base
19- # Mark this as a test image (moved from --label build flag to fix layer caching)
20- LABEL bootc.testimage="1"
21-
2218# This image installs build deps, pulls in our source code, and installs updated
2319# bootc binaries in /out. The intention is that the target rootfs is extracted from /out
2420# back into a final stage (without the build deps etc) below.
25- FROM base as buildroot
21+ FROM $ base as buildroot
2622# Flip this off to disable initramfs code
2723ARG initramfs=1
2824# This installs our buildroot, and we want to cache it independently of the rest.
@@ -40,6 +36,31 @@ FROM buildroot as sdboot-content
4036# Writes to /out
4137RUN /src/contrib/packaging/configure-systemdboot download
4238
39+ # We always do a "from scratch" build
40+ # https://docs.fedoraproject.org/en-US/bootc/building-from-scratch/
41+ # because this fixes https://github.com/containers/composefs-rs/issues/132
42+ # NOTE: Until we have https://gitlab.com/fedora/bootc/base-images/-/merge_requests/317
43+ # this stage will end up capturing whatever RPMs we find at this time.
44+ # NOTE: This is using the *stock* bootc binary, not the one we want to build from
45+ # local sources. We'll override it later.
46+ # NOTE: All your base belong to me.
47+ FROM $base as target-base
48+ RUN /usr/libexec/bootc-base-imagectl build-rootfs --manifest=standard /target-rootfs
49+
50+ FROM scratch as base
51+ COPY --from=target-base /target-rootfs/ /
52+ # Note we don't do any customization here yet
53+ # Mark this as a test image
54+ LABEL bootc.testimage="1"
55+ # Otherwise standard metadata
56+ LABEL containers.bootc 1
57+ LABEL ostree.bootable 1
58+ # https://pagure.io/fedora-kiwi-descriptions/pull-request/52
59+ ENV container=oci
60+ # Optional labels that only apply when running this image as a container. These keep the default entry point running under systemd.
61+ STOPSIGNAL SIGRTMIN+3
62+ CMD ["/sbin/init" ]
63+
4364# NOTE: Every RUN instruction past this point should use `--network=none`; we want to ensure
4465# all external dependencies are clearly delineated.
4566
0 commit comments