Skip to content

Commit 3fcfed0

Browse files
committed
hack: Also support --build-arg=base=<fedora>
Let's make it also easy to build using fedora. Signed-off-by: Colin Walters <[email protected]>
1 parent d65013c commit 3fcfed0

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

hack/Containerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
# This container build is just a demo effectively; it shows how one might
2-
# build bootc in a container flow, using Fedora ELN as the target.
3-
FROM quay.io/centos-bootc/centos-bootc:stream9 as build
4-
RUN dnf config-manager --set-enabled crb && dnf -y install cargo ostree-devel openssl-devel && dnf clean all
1+
# Build bootc from the current git into a c9s-bootc container image.
2+
# Use e.g. --build-arg=base=quay.io/fedora/fedora-bootc:40 to target
3+
# Fedora instead.
4+
ARG base=quay.io/centos-bootc/centos-bootc:stream9
5+
FROM $base as build
6+
COPY hack/build.sh /build.sh
7+
RUN /build.sh && rm -v /build.sh
58
COPY . /build
69
WORKDIR /build
710
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content
811
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
912
# We aren't using the full recommendations there, just the simple bits.
1013
RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make bin-archive && mkdir -p /out && cp target/bootc.tar.zst /out
1114

12-
FROM quay.io/centos-bootc/centos-bootc:stream9
15+
FROM $base
1316
COPY --from=build /out/bootc.tar.zst /tmp
1417
COPY --from=build /build/target/dev-rootfs/ /
1518
RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vf /tmp/*

hack/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -xeu
3+
. /usr/lib/os-release
4+
case $ID in
5+
centos|rhel) dnf config-manager --set-enabled crb;;
6+
fedora) dnf -y install dnf-utils ;;
7+
esac
8+
dnf -y builddep bootc

0 commit comments

Comments
 (0)