Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
f4bd8bde
Commit
f4bd8bde
authored
1 year ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
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
1 year ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
docker/Dockerfile
+39
-40
39 additions, 40 deletions
docker/Dockerfile
with
40 additions
and
41 deletions
.gitlab-ci.yml
+
1
−
1
View file @
f4bd8bde
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
docker/Dockerfile
+
39
−
40
View file @
f4bd8bde
# 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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment