@@ -8,10 +8,37 @@ ARG base=quay.io/centos-bootc/centos-bootc:stream9
8
8
FROM scratch as src
9
9
COPY . /src
10
10
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
+
11
38
# This image installs build deps, pulls in our source code, and installs updated
12
39
# bootc binaries in /out. The intention is that the target rootfs is extracted from /out
13
40
# back into a final stae (without the build deps etc) below.
14
- FROM $ base as build
41
+ FROM base as build
15
42
# This installs our package dependencies, and we want to cache it independently of the rest.
16
43
# Basically we don't want changing a .rs file to blow out the cache of packages. So we only
17
44
# copy files necessary
@@ -42,7 +69,7 @@ RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/rooth
42
69
cargo test --locked $unitargs
43
70
44
71
# The final image that derives from the original base and adds the release binaries
45
- FROM $ base
72
+ FROM base
46
73
# First, create a layer that is our new binaries.
47
74
COPY --from=build /out/ /
48
75
RUN <<EORUN
0 commit comments