From 5e8202c7b00a2a95751d09ab88bcb23f7327623a Mon Sep 17 00:00:00 2001 From: TheCodeLamp <12064217+TheCodeLamp@users.noreply.github.com> Date: Mon, 3 Aug 2026 12:30:54 +0200 Subject: [PATCH] Add build step for building helix --- Containerfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Containerfile b/Containerfile index 5eadc78..8d6e4b0 100644 --- a/Containerfile +++ b/Containerfile @@ -3,11 +3,37 @@ COPY build_scripts / FROM ghcr.io/nushell/nushell:latest-alpine as nushell +FROM docker.io/library/rust:1-bookworm as helix-builder + +ARG HELIX_COMMIT=079a789e8cb08ead67f19e1971a1b7438b37354b + +RUN git clone https://github.com/helix-editor/helix /usr/src/helix \ + && cd /usr/src/helix \ + && git checkout ${HELIX_COMMIT} + +WORKDIR /usr/src/helix + +ENV HELIX_DEFAULT_RUNTIME=/usr/lib/helix/runtime + +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/usr/src/helix/target \ + cargo build --profile opt --locked \ + && cp target/opt/hx /usr/local/bin/hx + +RUN --mount=type=cache,target=/usr/src/helix/target \ + mkdir -p /opt/helix/usr/bin /opt/helix/usr/lib/helix \ + && cp /usr/local/bin/hx /opt/helix/usr/bin/hx \ + && cp -r runtime /opt/helix/usr/lib/helix/runtime + + FROM quay.io/fedora/fedora-bootc:44 as base COPY --from=nushell /usr/bin/nu /usr/bin/nu RUN printf '/bin/nu\n/usr/bin/nu' >> /etc/shells +COPY --from=helix-builder /opt/helix/usr/bin/hx /usr/bin/hx +COPY --from=helix-builder /opt/helix/usr/lib/helix /usr/lib/helix + COPY yum-repos/custom.repo /etc/yum.repos.d/custom.repo RUN --mount=type=bind,from=ctx,source=/,target=/ctx \ @@ -28,6 +54,9 @@ FROM quay.io/fedora/fedora-kinoite:44 as desktop COPY --from=nushell /usr/bin/nu /usr/bin/nu RUN printf '/bin/nu\n/usr/bin/nu\n' >> /etc/shells +COPY --from=helix-builder /opt/helix/usr/bin/hx /usr/bin/hx +COPY --from=helix-builder /opt/helix/usr/lib/helix /usr/lib/helix + COPY yum-repos/custom.repo /etc/yum.repos.d/custom.repo RUN --mount=type=bind,from=ctx,source=/,target=/ctx \ @@ -60,6 +89,9 @@ COPY dracut.conf /usr/lib/dracut/dracut.conf.d/50-custom-ostree.conf COPY --from=nushell /usr/bin/nu /usr/bin/nu RUN printf '/bin/nu\n/usr/bin/nu\n' >> /etc/shells +COPY --from=helix-builder /opt/helix/usr/bin/hx /usr/bin/hx +COPY --from=helix-builder /opt/helix/usr/lib/helix /usr/lib/helix + COPY yum-repos/custom.repo /etc/yum.repos.d/custom.repo RUN --mount=type=bind,from=ctx,source=/,target=/ctx \