mirror of
https://github.com/containers/bootc.git
synced 2026-02-05 15:45:53 +01:00
This was a rather important miss; we need to pick up the kargs.d files when doing a `bootc install` too. Signed-off-by: Colin Walters <walters@verbum.org>
35 lines
1.5 KiB
Docker
35 lines
1.5 KiB
Docker
# 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.
|
|
#
|
|
# You can also generate an image with cloud-init and other dependencies
|
|
# with `--build-arg=tmt` which is intended for use particularly via
|
|
# https://tmt.readthedocs.io/en/stable/
|
|
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 test-bin-archive && mkdir -p /out && cp target/bootc.tar.zst /out
|
|
|
|
FROM $base
|
|
# We support e.g. adding cloud-init
|
|
ARG variant=
|
|
COPY hack/provision-derived.sh /tmp
|
|
RUN /tmp/provision-derived.sh "$variant" && rm -f /tmp/*.sh
|
|
# Also copy in some default install configs we use for testing
|
|
COPY hack/install-test-configs/* /usr/lib/bootc/install/
|
|
# And some test kargs
|
|
COPY hack/test-kargs /usr/lib/bootc/kargs.d/
|
|
# Inject our built code
|
|
COPY --from=build /out/bootc.tar.zst /tmp
|
|
RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vrf /tmp/*
|
|
# Also copy over arbitrary bits from the target root
|
|
COPY --from=build /build/target/dev-rootfs/ /
|
|
# Test our own linting
|
|
RUN bootc container lint
|