Skip to content
Snippets Groups Projects
Commit ccc97e92 authored by Gilles Filippini's avatar Gilles Filippini
Browse files

build (docker): build only when no duniter binary

exists in the 'build' directory.

This allow to use this Dockerfile at CI time (where 'build/duniter' exists)
or for a full build from the source tree.
parent 2f87b413
No related branches found
No related tags found
1 merge request!7build: docker image and compose file
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
......@@ -6,6 +6,7 @@
# with the image paritytech/ci-linux:production (currently based on
# debian:buster-slim) used by the gitlab CI
FROM rust:1-buster as build
WORKDIR /root
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
......@@ -16,8 +17,13 @@ COPY . .
# build duniter
ARG threads=1
RUN CARGO_PROFILE_RELEASE_LTO="true" \
cargo build --release -j $threads
RUN test -x build/duniter || \
( \
CARGO_PROFILE_RELEASE_LTO="true" \
cargo build --release -j $threads && \
mkdir -p build && \
mv target/release/duniter build/ \
)
# ------------------------------------------------------------------------------
# Final Stage
......@@ -30,7 +36,7 @@ LABEL version="0.0.0"
LABEL description="Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency"
# Intall
COPY --from=build /target/release/duniter /usr/local/bin/duniter
COPY --from=build /root/build/duniter /usr/local/bin/duniter
COPY docker/docker-entrypoint /usr/local/bin/
# Configuration
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment