Files
pezkuwi-subxt/polkadot/scripts/docker/staking-miner/staking_miner-builder.Dockerfile
T
Chevdor bb6a3fb0a2 staking-miner: docker images (#3682)
* staking-miner: docker image

* renaming

* add doc

* fix readme

* remove the creation of home for the polkadot user

* new builder image for the staking-miner

* remove mentions of the polkadot binary and add env

* foc: fix doc

* fix typos and dictionnary

* doc + sync up the 2 images

* doc: fine tuning the doc

* doc: security warning
2021-09-07 08:53:30 +00:00

47 lines
1.3 KiB
Docker

FROM paritytech/ci-linux:production as builder
# metadata
ARG VCS_REF
ARG BUILD_DATE
ARG IMAGE_NAME="staking-miner"
ARG PROFILE=release
LABEL description="This is the build stage. Here we create the binary."
WORKDIR /app
COPY . /app
RUN cargo build --locked --$PROFILE --package staking-miner
# ===== SECOND STAGE ======
FROM debian:buster-slim
LABEL description="This is the 2nd stage: a very small image where we copy the binary."
LABEL io.parity.image.authors="devops-team@parity.io" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.title="${IMAGE_NAME}" \
io.parity.image.description="staking-miner for substrate based chains" \
io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/staking-miner/staking_miner-builder.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/paritytech/polkadot/"
ARG PROFILE=release
COPY --from=builder /app/target/$PROFILE/staking-miner /usr/local/bin
RUN useradd -u 1000 -U -s /bin/sh miner && \
rm -rf /usr/bin /usr/sbin
# show backtraces
ENV RUST_BACKTRACE 1
USER miner
ENV SEED=""
ENV URI="wss://rpc.polkadot.io"
ENV RUST_LOG="info"
# check if the binary works in this container
RUN /usr/local/bin/staking-miner --version
ENTRYPOINT [ "/usr/local/bin/staking-miner"]