From 908c347bb9df402a74d793966afb22c6a79bb6d5 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 23 Oct 2024 15:17:53 -0400 Subject: [PATCH] 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. --- Containerfile | 6 ++++++ README.md | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Containerfile b/Containerfile index 59c3317..47257d1 100644 --- a/Containerfile +++ b/Containerfile @@ -39,6 +39,12 @@ COPY . /src WORKDIR /src RUN rm -vf /src/*.repo 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 \ --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \ rpm-ostree compose image --image-config fedora-bootc-config.json \ diff --git a/README.md b/README.md index a409473..65dc8d9 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,6 @@ Fedora repos and dnf variables. E.g.: podman build --from quay.io/fedora/fedora:41 ... ``` -WIP: THIS DOESN'T WORK YET. - ### Deriving You are of course also free to fork, customize, and build base images yourself.