Files
pezkuwi-subxt/substrate/Dockerfile
T
Chevdor 168de867f5 Also change the image for the second stage (#1103)
The fix in #1101 fixed the build but it produces an image that could not run.
The PR fixes that as well.
Ref #1099
2018-11-12 20:13:13 +01:00

38 lines
863 B
Docker

FROM alpine:edge AS builder
LABEL maintainer="chevdor@gmail.com"
LABEL description="This is the build stage for Substrate. Here we create the binary."
RUN apk add build-base \
cmake \
linux-headers \
openssl-dev \
cargo
ARG PROFILE=release
WORKDIR /substrate
COPY . /substrate
RUN cargo build --$PROFILE
# ===== SECOND STAGE ======
FROM alpine:edge
LABEL maintainer="chevdor@gmail.com"
LABEL description="This is the 2nd stage: a very small image where we copy the Substrate binary."
ARG PROFILE=release
COPY --from=builder /substrate/target/$PROFILE/substrate /usr/local/bin
RUN apk add --no-cache ca-certificates \
libstdc++ \
openssl
RUN rm -rf /usr/lib/python* && \
mkdir -p /root/.local/share/Substrate && \
ln -s /root/.local/share/Substrate /data
EXPOSE 30333 9933 9944
VOLUME ["/data"]
CMD ["/usr/local/bin/substrate"]