1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-06 00:45:22 +01:00
Files
bootc/hack/Containerfile
Colin Walters c69e132004 Merge pull request #548 from cgwalters/test-improvements
Move install tests shell script into Rust
2024-05-20 15:20:56 -04:00

19 lines
884 B
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.
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
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/*