diff --git a/Dockerfile b/Dockerfile index 6a1d0a2..6cd66fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,7 @@ +ARG TARGET_ARCH=x86_64 +ARG TARGET=hermit-${TARGET_ARCH} +ARG PREFIX=/opt/hermit + FROM --platform=$BUILDPLATFORM rust:bookworm AS kernel ADD --link https://github.com/hermit-os/kernel.git#hermit-c /kernel WORKDIR /kernel @@ -37,7 +41,9 @@ ADD --link https://github.com/hermit-os/newlib.git newlib ADD --link https://github.com/hermit-os/pthread-embedded.git pte ADD --link ./toolchain.sh ./toolchain.sh -RUN ./toolchain.sh x86_64-hermit /opt/hermit +ARG TARGET +ARG PREFIX +RUN ./toolchain.sh ${TARGET} ${PREFIX} FROM rust:bookworm AS toolchain @@ -51,6 +57,7 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/*; -COPY --from=builder /opt/hermit /opt/hermit -ENV PATH=/opt/hermit/bin:$PATH \ - LD_LIBRARY_PATH=/opt/hermit/lib:$LD_LIBRARY_PATH +ARG PREFIX +COPY --from=builder ${PREFIX} ${PREFIX} +ENV PATH=${PREFIX}/bin:$PATH \ + LD_LIBRARY_PATH=${PREFIX}/lib:$LD_LIBRARY_PATH