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

We have new enough rpm-ostree in Fedora for this now.
This commit is contained in:
Jonathan Lebon 2024-10-23 15:21:21 -04:00
parent 908c347bb9
commit 44258fdde4
No known key found for this signature in database
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