Containerfile: add temporary hack for `--from` handling

Using `--from` to set the target releasever doesn't work yet because we
_need_ to set the `releasever` field since the repo files reference it.
There's a pending rpm-ostree PR to fix this but for now hack around it
by manually injecting the necessary variables in the treefile.
This commit is contained in:
Jonathan Lebon 2024-10-23 15:17:53 -04:00
parent 6315275af7
commit 908c347bb9
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View File

@ -39,6 +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 \
rpm-ostree compose image --image-config fedora-bootc-config.json \ rpm-ostree compose image --image-config fedora-bootc-config.json \

View File

@ -42,8 +42,6 @@ Fedora repos and dnf variables. E.g.:
podman build --from quay.io/fedora/fedora:41 ... podman build --from quay.io/fedora/fedora:41 ...
``` ```
WIP: THIS DOESN'T WORK YET.
### Deriving ### Deriving
You are of course also free to fork, customize, and build base images yourself. You are of course also free to fork, customize, and build base images yourself.