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:
parent
6315275af7
commit
908c347bb9
|
|
@ -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 \
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue