Skip to content

Commit f4b01ab

Browse files
authored
Merge pull request #1446 from cgwalters/opt-continuous
Dockerfile: Support pulling in the continuous repo
2 parents a617a6c + 8557d1a commit f4b01ab

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ jobs:
5757
- uses: actions/checkout@v4
5858
- name: Build and run container integration tests
5959
run: sudo just run-container-integration run-container-external-tests
60+
container-continuous:
61+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'control/skip-ci') }}
62+
runs-on: ubuntu-24.04
63+
steps:
64+
- name: Get a newer podman for heredoc support (from debian testing)
65+
run: |
66+
set -eux
67+
echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
68+
sudo apt update
69+
sudo apt install -y crun/testing podman/testing skopeo/testing
70+
- name: Installdeps
71+
run: sudo apt update && sudo apt install just
72+
- uses: actions/checkout@v4
73+
- name: Build with continuous repo enabled
74+
run: sudo just build --build-arg=continuous_repo=1
6075
cargo-deny:
6176
runs-on: ubuntu-latest
6277
steps:

Dockerfile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,37 @@ ARG base=quay.io/centos-bootc/centos-bootc:stream9
88
FROM scratch as src
99
COPY . /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.
4774
COPY --from=build /out/ /
4875
RUN <<EORUN

0 commit comments

Comments
 (0)