Merge branch 'pr/cleanup-treefile-hacks' into 'main'

Containerfile: clean up temporary hack for `--from` handling

See merge request fedora/bootc/base-images!64
This commit is contained in:
Colin Walters (Red Hat) 2024-12-17 20:15:28 +00:00
commit cf1cab8b60
1 changed files with 2 additions and 7 deletions

View File

@ -39,17 +39,12 @@ COPY . /src
WORKDIR /src WORKDIR /src
RUN rm -vf /src/*.repo RUN rm -vf /src/*.repo
COPY --from=repos /etc/yum.repos.d/*.repo /src COPY --from=repos /etc/yum.repos.d/*.repo /src
# Brutally inject releasever and repos into manifest file. This is a major hack
# until rpm-ostree does this on its own: https://github.com/coreos/rpm-ostree/pull/5136
RUN --mount=type=bind,from=repos,src=/,dst=/repos source /repos/etc/os-release && \
echo -e "\nreleasever: $VERSION_ID" >> ${MANIFEST} && \
echo -e "\nrepos:\n" >> ${MANIFEST} && \
dnf repolist --setopt=reposdir=. | tail -n +2 | cut -f1 -d' ' | sed 's/^/- /' >> ${MANIFEST}
RUN --mount=type=cache,target=/workdir \ RUN --mount=type=cache,target=/workdir \
--mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \ --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \
--mount=type=bind,from=repos,src=/,dst=/repos \
rpm-ostree compose image --image-config fedora-bootc-config.json \ rpm-ostree compose image --image-config fedora-bootc-config.json \
--cachedir=/workdir --format=ociarchive --initialize ${MANIFEST} \ --cachedir=/workdir --format=ociarchive --initialize ${MANIFEST} \
/buildcontext/out.ociarchive --source-root=/repos /buildcontext/out.ociarchive
FROM oci-archive:./out.ociarchive FROM oci-archive:./out.ociarchive
# Need to reference builder here to force ordering. But since we have to run # Need to reference builder here to force ordering. But since we have to run