Skip to content

chore: use experimental build-chunked-oci #349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:

- name: Rechunk
id: rechunk
if: false
uses: rsturla/eternal-main/.github/actions/rechunk@main
with:
builder: ${{ steps.build.outputs.builder }}
Expand Down Expand Up @@ -175,6 +176,7 @@ jobs:

- name: Rechunk
id: rechunk
if: false
uses: rsturla/eternal-main/.github/actions/rechunk@main
with:
builder: ${{ steps.build.outputs.builder }}
Expand Down
21 changes: 20 additions & 1 deletion lumina/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG BASE_TAG=41
ARG FEDORA_VERSION=${BASE_TAG}


FROM ${BASE_REGISTRY}:${BASE_TAG}
FROM ${BASE_REGISTRY}:${BASE_TAG} AS rootfs

ARG FEDORA_VERSION
ARG BASE_IMAGE
Expand All @@ -15,3 +15,22 @@ COPY scripts/ /tmp/scripts/
RUN chmod +x /tmp/scripts/*.sh /tmp/scripts/*.sh /tmp/scripts/_${BASE_IMAGE}/*.sh && \
/tmp/scripts/setup.sh && \
/tmp/scripts/cleanup.sh

# This builder image can be anything as long as it has a new enough
# rpm-ostree.
FROM quay.io/fedora/fedora-bootc:rawhide AS builder
RUN --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \
--mount=from=rootfs,dst=/rootfs \
rm -rf /buildcontext/out.oci && \
rpm-ostree experimental compose build-chunked-oci --bootc --format-version=1 \
--rootfs=/rootfs --output /buildcontext/out.oci

# Finally, output the OCI archive back into our final container image. Here we
# can add labels and other metadata - note that no metadata was inherited from
# the source image - only the root filesystem!
FROM oci:./out.oci
# Need to reference builder here to force ordering. But since we have to run
# something anyway, we might as well cleanup after ourselves.
RUN --mount=type=bind,from=builder,src=.,target=/var/tmp \
--mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \
rm -rf /buildcontext/out.oci
Loading