Containerfile: use cache again

We dropped the cache line in df45d53 because it wasn't being used and
also turned out to require some upstream changes [1] to be useful.

Now that rpm-ostree-2025.9 has been released let's default to using
caching again, which will help improve the local developer workflow
by allowing for iterating on builds and not having to re-download
RPMs each cycle.

[1] https://github.com/coreos/rpm-ostree/pull/5391
This commit is contained in:
Dusty Mabe 2025-07-29 17:05:15 -04:00 committed by Miguel Martín
parent 09861eb300
commit 359c4c04a9

View file

@ -28,7 +28,8 @@ ARG MANIFEST=fedora-standard
COPY . /src
WORKDIR /src
RUN rm -vf /src/*.repo
RUN --mount=type=bind,rw,from=repos,src=/,dst=/repos <<EORUN
RUN --mount=type=cache,rw,id=bootc-base-image-cache,target=/cache \
--mount=type=bind,rw,from=repos,src=/,dst=/repos <<EORUN
set -xeuo pipefail
# Put our manifests into the builder image in the same location they'll be in the
# final image.
@ -39,7 +40,8 @@ install -m 0755 -t /usr/libexec ./bootc-base-imagectl
/usr/libexec/bootc-base-imagectl list >/dev/null
# Run the build script in the same way we expect custom images to do, and also
# "re-inject" the manifests into the target, so secondary container builds can use it.
/usr/libexec/bootc-base-imagectl build-rootfs --reinject --manifest=${MANIFEST} /repos /target-rootfs
/usr/libexec/bootc-base-imagectl build-rootfs \
--cachedir=/cache --reinject --manifest=${MANIFEST} /repos /target-rootfs
EORUN
# This pulls in the rootfs generated in the previous step