-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #547 from cgwalters/hack-c9s-or-fedora
two minor patches
- Loading branch information
Showing
3 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
# This container build is just a demo effectively; it shows how one might | ||
# build bootc in a container flow, using Fedora ELN as the target. | ||
FROM quay.io/centos-bootc/centos-bootc:stream9 as build | ||
RUN dnf config-manager --set-enabled crb && dnf -y install cargo ostree-devel openssl-devel && dnf clean all | ||
# Build bootc from the current git into a c9s-bootc container image. | ||
# Use e.g. --build-arg=base=quay.io/fedora/fedora-bootc:40 to target | ||
# Fedora instead. | ||
ARG base=quay.io/centos-bootc/centos-bootc:stream9 | ||
FROM $base as build | ||
COPY hack/build.sh /build.sh | ||
RUN /build.sh && rm -v /build.sh | ||
COPY . /build | ||
WORKDIR /build | ||
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content | ||
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/ | ||
# We aren't using the full recommendations there, just the simple bits. | ||
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 | ||
|
||
FROM quay.io/centos-bootc/centos-bootc:stream9 | ||
FROM $base | ||
COPY --from=build /out/bootc.tar.zst /tmp | ||
COPY --from=build /build/target/dev-rootfs/ / | ||
RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vf /tmp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -xeu | ||
. /usr/lib/os-release | ||
case $ID in | ||
centos|rhel) dnf config-manager --set-enabled crb;; | ||
fedora) dnf -y install dnf-utils ;; | ||
esac | ||
dnf -y builddep bootc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters