@@ -8,10 +8,37 @@ ARG base=quay.io/centos-bootc/centos-bootc:stream9
88FROM scratch as src
99COPY . /src
1010
11+ FROM $base as base
12+ # Set this to anything non-0 to enable https://copr.fedorainfracloud.org/coprs/g/CoreOS/continuous/
13+ ARG continuous_repo=0
14+ RUN <<EORUN
15+ set -xeuo pipefail
16+ if [ "${continuous_repo}" == 0 ]; then
17+ exit 0
18+ fi
19+ # Sadly dnf copr enable looks for epel, not centos-stream....
20+ . /usr/lib/os-release
21+ case $ID in
22+ centos)
23+ curl -L -o /etc/yum.repos.d/continuous.repo https://copr.fedorainfracloud.org/coprs/g/CoreOS/continuous/repo/centos-stream-$VERSION_ID/group_CoreOS-continuous-centos-stream-$VERSION_ID.repo
24+ ;;
25+ fedora)
26+ if rpm -q dnf5 &>/dev/null; then
27+ dnf -y install dnf5-plugins
28+ fi
29+ dnf copr enable -y @CoreOS/continuous
30+ ;;
31+ *) echo "error: Unsupported OS '$ID'" >&2; exit 1
32+ ;;
33+ esac
34+ dnf -y upgrade ostree bootupd
35+ rm -rf /var/cache/* /var/lib/dnf /var/lib/rhsm /var/log/*
36+ EORUN
37+
1138# This image installs build deps, pulls in our source code, and installs updated
1239# bootc binaries in /out. The intention is that the target rootfs is extracted from /out
1340# back into a final stae (without the build deps etc) below.
14- FROM $ base as build
41+ FROM base as build
1542# This installs our package dependencies, and we want to cache it independently of the rest.
1643# Basically we don't want changing a .rs file to blow out the cache of packages. So we only
1744# copy files necessary
@@ -42,7 +69,7 @@ RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/rooth
4269 cargo test --locked $unitargs
4370
4471# The final image that derives from the original base and adds the release binaries
45- FROM $ base
72+ FROM base
4673# First, create a layer that is our new binaries.
4774COPY --from=build /out/ /
4875RUN <<EORUN
0 commit comments