forked from containers/bootc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
15 lines (14 loc) · 932 Bytes
/
Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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
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
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/*