This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new builder image for the staking-miner
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
23
scripts/docker/staking-miner/staking_miner-builder.Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
File renamed without changes.