Skip to content
Snippets Groups Projects

build: docker image and compose file

Merged pini requested to merge docker into master
All threads resolved!
2 files
+ 12
29
Compare changes
  • Side-by-side
  • Inline
Files
2
  • 2f87b413
    Because the CI jobs use the paritytech/ci-linux image (debian based),
    maintained by the substrate developers, and which contains everything it
    does to do CI stuff on a substrate project.
    
    Remove RUSTFLAGS environment variable as it is needed for Alpine Linux
    only.
+ 11
28
@@ -2,50 +2,33 @@
# Build Stage
# ------------------------------------------------------------------------------
FROM alpine as build
RUN apk update && \
apk add ca-certificates curl && \
update-ca-certificates && \
apk add --update \
cmake \
make \
pkgconfig \
gcc \
g++ \
musl-dev \
linux-headers \
protoc \
openssl-dev \
clang-dev
# install latest stable rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# Building for Debian buster because we need the binary to be compatible
# with the image paritytech/ci-linux:production (currently based on
# debian:buster-slim) used by the gitlab CI
FROM rust:1-buster as build
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
clang
# Copy source tree
COPY . .
# build duniter
ARG threads=1
RUN source ~/.cargo/env && \
CARGO_PROFILE_RELEASE_LTO="true" \
RUSTFLAGS="-C target-feature=-crt-static" \
cargo build --release -j $threads
RUN CARGO_PROFILE_RELEASE_LTO="true" \
cargo build --release -j $threads
# ------------------------------------------------------------------------------
# Final Stage
# ------------------------------------------------------------------------------
FROM alpine
FROM debian:buster-slim
LABEL maintainer="Gilles Filippini <gilles.filippini@pini.fr>"
LABEL version="0.0.0"
LABEL description="Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency"
# Dependancies
RUN apk update && \
apk add libstdc++
# Intall
COPY --from=build /target/release/duniter /usr/local/bin/duniter
COPY docker/docker-entrypoint /usr/local/bin/
Loading