Skip to content
Snippets Groups Projects
Commit f2e9aa16 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

fix(#195): cross-compilation was broken

parent 437324c8
No related branches found
No related tags found
No related merge requests found
Pipeline #37977 waiting for manual action
# Workaround for https://github.com/containers/buildah/issues/4742
FROM debian:bullseye-slim as target
# ------------------------------------------------------------------------------
# Build Stage
# ------------------------------------------------------------------------------
......@@ -8,10 +11,15 @@ FROM --platform=$BUILDPLATFORM rust:1-bullseye as build
ARG BUILDPLATFORM
ARG TARGETPLATFORM
# Debug
RUN echo "BUILDPLATFORM = $BUILDPLATFORM"
RUN echo "TARGETPLATFORM = $TARGETPLATFORM"
# We need the target arch triplet in both Debian and rust flavor
RUN echo "DEBIAN_ARCH_TRIPLET='$(dpkg-architecture -A${TARGETPLATFORM#linux/} -qDEB_TARGET_MULTIARCH)'" >>/root/dynenv
RUN . /root/dynenv && \
echo "RUST_ARCH_TRIPLET='$(echo "$DEBIAN_ARCH_TRIPLET" | sed -E 's/-linux-/-unknown&/')'" >>/root/dynenv
RUN cat /root/dynenv
WORKDIR /root
......@@ -65,7 +73,7 @@ RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \
# Final Stage
# ------------------------------------------------------------------------------
FROM debian:bullseye-slim
FROM target
LABEL maintainer="Gilles Filippini <gilles.filippini@pini.fr>"
LABEL version="0.0.0"
......@@ -88,5 +96,9 @@ USER duniter
# Intall
COPY --from=build /root/build /usr/local/bin/
COPY --from=build /root/dynenv /var/lib/duniter
COPY docker/docker-entrypoint /usr/local/bin/
COPY docker/docker-distance-entrypoint /usr/local/bin/
# Debug
RUN cat /var/lib/duniter/dynenv
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment