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

fix(#125): review: revert Dockerfile changes + build on podman

parent 4bc600ce
No related branches found
No related tags found
No related merge requests found
Pipeline #33579 failed
...@@ -70,7 +70,7 @@ fmt_and_clippy: ...@@ -70,7 +70,7 @@ fmt_and_clippy:
- echo podman build --layers --tag "$IMAGE_NAME:$IMAGE_TAG" -f docker/Dockerfile $PODMAN_BUILD_OPTIONS . - echo podman build --layers --tag "$IMAGE_NAME:$IMAGE_TAG" -f docker/Dockerfile $PODMAN_BUILD_OPTIONS .
- podman build --layers --tag "$IMAGE_NAME:$IMAGE_TAG" -f docker/Dockerfile $PODMAN_BUILD_OPTIONS . - podman build --layers --tag "$IMAGE_NAME:$IMAGE_TAG" -f docker/Dockerfile $PODMAN_BUILD_OPTIONS .
tags: tags:
- kepler - podman
.docker_deploy: .docker_deploy:
stage: deploy stage: deploy
......
# Workaround for https://github.com/containers/buildah/issues/4742 # Workaround for https://github.com/containers/buildah/issues/4742
FROM debian:bullseye-slim as target FROM debian:bullseye-slim as target
#ARG TARGETPLATFORM
# ------------------------------------------------------------------------------
#RUN apt-get update # Build Stage
#RUN apt-get install ca-certificates curl gnupg # ------------------------------------------------------------------------------
#RUN install -m 0755 -d /etc/apt/keyrings
#RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg # When building for a foreign arch, use cross-compilation
#RUN chmod a+r /etc/apt/keyrings/docker.gpg # https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
#RUN echo \ FROM --platform=$BUILDPLATFORM rust:1-bullseye as build
# "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ ARG BUILDPLATFORM
# "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ ARG TARGETPLATFORM
# tee /etc/apt/sources.list.d/docker.list > /dev/null
#
#RUN apt-get update
#RUN apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
RUN docker run --entrypoint /bin/sh hello-world echo FromDocker
# We need the target arch triplet in both Debian and rust flavor # 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 echo "DEBIAN_ARCH_TRIPLET='$(dpkg-architecture -A${TARGETPLATFORM#linux/} -qDEB_TARGET_MULTIARCH)'" >>/root/dynenv
...@@ -38,34 +33,38 @@ RUN if [ "$debug" = 0 ]; then \ ...@@ -38,34 +33,38 @@ RUN if [ "$debug" = 0 ]; then \
echo "TARGET_FOLDER=debug" >>/root/dynenv; \ echo "TARGET_FOLDER=debug" >>/root/dynenv; \
fi fi
## Configure cross-build environment if need be # Configure cross-build environment if need be
#RUN set -x && \ RUN set -x && \
# if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \ if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \
# . /root/dynenv && \ . /root/dynenv && \
# apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \ apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \
# rustup target add "$RUST_ARCH_TRIPLET" && \ rustup target add "$RUST_ARCH_TRIPLET" && \
# : https://github.com/rust-lang/cargo/issues/4133 && \ : https://github.com/rust-lang/cargo/issues/4133 && \
# echo "RUSTFLAGS='-C linker=$DEBIAN_ARCH_TRIPLET-gcc'; export RUSTFLAGS" >>/root/dynenv; \ echo "RUSTFLAGS='-C linker=$DEBIAN_ARCH_TRIPLET-gcc'; export RUSTFLAGS" >>/root/dynenv; \
# fi fi
# Build # Build
RUN set -x && \ RUN set -x && \
cargo xtask release-runtime 600 cat /root/dynenv && \
. /root/dynenv && \
## Run tests if requested, expted when cross-building cargo build --locked $CARGO_OPTIONS --target "$RUST_ARCH_TRIPLET" && \
#ARG cucumber=0 mkdir -p build && \
#RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \ mv target/$RUST_ARCH_TRIPLET/$TARGET_FOLDER/duniter build/
# cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests && \
# cargo cucumber -i account_creation* && \ # Run tests if requested, expted when cross-building
# cargo cucumber -i certification* && \ ARG cucumber=0
# cargo cucumber -i identity_creation* && \ RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \
# cargo cucumber -i monetary_mass* && \ cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests && \
# cargo cucumber -i oneshot_account* && \ cargo cucumber -i account_creation* && \
# cargo cucumber -i transfer_all* && \ cargo cucumber -i certification* && \
# cd target/debug/deps/ && \ cargo cucumber -i identity_creation* && \
# rm cucumber_tests-*.d && \ cargo cucumber -i monetary_mass* && \
# mv cucumber_tests* ../../../build/duniter-cucumber; \ cargo cucumber -i oneshot_account* && \
# fi cargo cucumber -i transfer_all* && \
cd target/debug/deps/ && \
rm cucumber_tests-*.d && \
mv cucumber_tests* ../../../build/duniter-cucumber; \
fi
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Final Stage # Final Stage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment