File tree Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 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
5
8
COPY . /build
6
9
WORKDIR /build
7
10
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content
8
11
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
9
12
# We aren't using the full recommendations there, just the simple bits.
10
13
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
11
14
12
- FROM quay.io/centos-bootc/centos-bootc:stream9
15
+ FROM $base
13
16
COPY --from=build /out/bootc.tar.zst /tmp
14
17
COPY --from=build /build/target/dev-rootfs/ /
15
18
RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vf /tmp/*
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -15,8 +15,7 @@ pub fn generate_manpages(directory: &Utf8Path) -> Result<()> {
15
15
fn generate_one ( directory : & Utf8Path , cmd : Command ) -> Result < ( ) > {
16
16
let version = env ! ( "CARGO_PKG_VERSION" ) ;
17
17
let name = cmd. get_name ( ) ;
18
- let bin_name = cmd. get_bin_name ( )
19
- . unwrap_or_else ( || name) ;
18
+ let bin_name = cmd. get_bin_name ( ) . unwrap_or_else ( || name) ;
20
19
let path = directory. join ( format ! ( "{name}.8" ) ) ;
21
20
println ! ( "Generating {path}..." ) ;
22
21
@@ -37,12 +36,13 @@ fn generate_one(directory: &Utf8Path, cmd: Command) -> Result<()> {
37
36
38
37
for subcmd in cmd. get_subcommands ( ) . filter ( |c| !c. is_hide_set ( ) ) {
39
38
let subname = format ! ( "{}-{}" , name, subcmd. get_name( ) ) ;
40
- let bin_name = format ! ( "{} {}" , bin_name, subcmd. get_name( ) ) ;
39
+ let bin_name = format ! ( "{} {}" , bin_name, subcmd. get_name( ) ) ;
41
40
// SAFETY: Latest clap 4 requires names are &'static - this is
42
41
// not long-running production code, so we just leak the names here.
43
42
let subname = & * std:: boxed:: Box :: leak ( subname. into_boxed_str ( ) ) ;
44
43
let bin_name = & * std:: boxed:: Box :: leak ( bin_name. into_boxed_str ( ) ) ;
45
- let subcmd = subcmd. clone ( )
44
+ let subcmd = subcmd
45
+ . clone ( )
46
46
. name ( subname)
47
47
. alias ( subname)
48
48
. bin_name ( bin_name)
You can’t perform that action at this time.
0 commit comments