Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
new builder image for the staking-miner
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Aug 27, 2021
1 parent 89ade56 commit af2e3f8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Self built Docker image

The Polkadot repo contains several options to build Docker images for Polkadot.
This folder contains a self-contained image that does not require a linux pre-built binary.
Instead, building the image is possible on any host having docker installed and will
build Polkadot inside Docker. That also means that no Rust toolchain is required on the host
machine for the build to suceed.
23 changes: 23 additions & 0 deletions scripts/docker/staking-miner/staking_miner-builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM paritytech/ci-linux:production as builder
LABEL description="This is the build stage for Polkadot. Here we create the binary."

ARG PROFILE=release
WORKDIR /polkadot

COPY . /polkadot

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 Polkadot binary."
ARG PROFILE=release
COPY --from=builder /polkadot/target/$PROFILE/staking-miner /usr/local/bin

RUN useradd -m -u 1000 -U -s /bin/sh miner && \
rm -rf /usr/bin /usr/sbin

USER miner

ENTRYPOINT [ "/usr/local/bin/staking-miner"]

0 comments on commit af2e3f8

Please sign in to comment.