diff --git a/docker/Dockerfile b/docker/Dockerfile index c341a604359374bd60805fb51c054f42516f1da8..49aafb0b372a4aa8c252af9de412dbd92b79b102 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,8 +7,7 @@ FROM debian:bullseye-slim as target # When building for a foreign arch, use cross-compilation # https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ -FROM --platform=$BUILDPLATFORM rust:1-bullseye as build -ARG BUILDPLATFORM +FROM rust:1-bullseye as build ARG TARGETPLATFORM # We need the target arch triplet in both Debian and rust flavor @@ -33,15 +32,15 @@ RUN if [ "$debug" = 0 ]; then \ echo "TARGET_FOLDER=debug" >>/root/dynenv; \ fi -# Configure cross-build environment if need be -RUN set -x && \ - if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \ - . /root/dynenv && \ - apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \ - rustup target add "$RUST_ARCH_TRIPLET" && \ - : https://github.com/rust-lang/cargo/issues/4133 && \ - echo "RUSTFLAGS='-C linker=$DEBIAN_ARCH_TRIPLET-gcc'; export RUSTFLAGS" >>/root/dynenv; \ - fi +## Configure cross-build environment if need be +#RUN set -x && \ +# if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \ +# . /root/dynenv && \ +# apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \ +# rustup target add "$RUST_ARCH_TRIPLET" && \ +# : https://github.com/rust-lang/cargo/issues/4133 && \ +# echo "RUSTFLAGS='-C linker=$DEBIAN_ARCH_TRIPLET-gcc'; export RUSTFLAGS" >>/root/dynenv; \ +# fi # Build RUN set -x && \ @@ -49,20 +48,20 @@ RUN set -x && \ . /root/dynenv && \ cargo xtask release-runtime 600 -# Run tests if requested, expted when cross-building -ARG cucumber=0 -RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \ - cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests && \ - cargo cucumber -i account_creation* && \ - cargo cucumber -i certification* && \ - cargo cucumber -i identity_creation* && \ - cargo cucumber -i monetary_mass* && \ - cargo cucumber -i oneshot_account* && \ - cargo cucumber -i transfer_all* && \ - cd target/debug/deps/ && \ - rm cucumber_tests-*.d && \ - mv cucumber_tests* ../../../build/duniter-cucumber; \ - fi +## Run tests if requested, expted when cross-building +#ARG cucumber=0 +#RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \ +# cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests && \ +# cargo cucumber -i account_creation* && \ +# cargo cucumber -i certification* && \ +# cargo cucumber -i identity_creation* && \ +# cargo cucumber -i monetary_mass* && \ +# cargo cucumber -i oneshot_account* && \ +# cargo cucumber -i transfer_all* && \ +# cd target/debug/deps/ && \ +# rm cucumber_tests-*.d && \ +# mv cucumber_tests* ../../../build/duniter-cucumber; \ +# fi # ------------------------------------------------------------------------------ # Final Stage