|
1 | | -# Runtime image expecting a pre-built binary alongside the Docker build context. |
2 | | -FROM ubuntu:20.04 |
| 1 | +FROM docker.io/library/ubuntu:20.04 |
3 | 2 |
|
4 | | -# Metadata |
5 | | -ARG VCS_REF=unknown |
6 | | -ARG BUILD_DATE=unknown |
| 3 | +# metadata |
| 4 | +ARG VCS_REF |
| 5 | +ARG BUILD_DATE |
7 | 6 |
|
8 | 7 | LABEL io.parity.image.authors= "[email protected]" \ |
9 | | - io.parity.image.vendor="Parity Technologies" \ |
10 | | - io.parity.image.title="polkadot-staking-miner" \ |
11 | | - io.parity.image.description="Polkadot staking miner for substrate based chains" \ |
12 | | - io.parity.image.source="https://github.com/paritytech/polkadot-staking-miner/blob/${VCS_REF}/Dockerfile" \ |
13 | | - io.parity.image.revision="${VCS_REF}" \ |
14 | | - io.parity.image.created="${BUILD_DATE}" \ |
15 | | - io.parity.image.documentation="https://github.com/paritytech/polkadot/" |
16 | | - |
17 | | -# Backtraces & useful defaults |
18 | | -ENV RUST_BACKTRACE=1 \ |
19 | | - SEED="" \ |
20 | | - URI="wss://rpc.polkadot.io" \ |
21 | | - RUST_LOG="info" |
22 | | - |
23 | | -# Install runtime dependencies (libssl1.1 still available on focal) |
| 8 | + io.parity.image.vendor="Parity Technologies" \ |
| 9 | + io.parity.image.title="polkadot-staking-miner" \ |
| 10 | + io.parity.image.description="Polkadot staking miner for substrate based chains" \ |
| 11 | + io.parity.image.source="https://github.com/paritytech/polkadot-staking-miner/blob/${VCS_REF}/Dockerfile" \ |
| 12 | + io.parity.image.revision="${VCS_REF}" \ |
| 13 | + io.parity.image.created="${BUILD_DATE}" \ |
| 14 | + io.parity.image.documentation="https://github.com/paritytech/polkadot/" |
| 15 | + |
| 16 | +# show backtraces |
| 17 | +ENV RUST_BACKTRACE 1 |
| 18 | + |
| 19 | +# install tools and dependencies |
24 | 20 | RUN apt-get update && \ |
25 | 21 | DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
26 | | - libssl1.1 \ |
27 | | - ca-certificates && \ |
| 22 | + libssl1.1 \ |
| 23 | + ca-certificates && \ |
| 24 | + # apt cleanup |
28 | 25 | apt-get autoremove -y && \ |
29 | 26 | apt-get clean && \ |
30 | | - find /var/lib/apt/lists/ -type f -not -name lock -delete && \ |
| 27 | + find /var/lib/apt/lists/ -type f -not -name lock -delete; \ |
31 | 28 | useradd -u 10000 -U -s /bin/sh miner |
32 | 29 |
|
33 | | -# Copy the pre-built binary into the image |
| 30 | +# add binary to docker image |
34 | 31 | COPY ./polkadot-staking-miner /usr/local/bin |
35 | 32 |
|
36 | | -# Create writable workspace and output directories |
37 | | -RUN mkdir -p /workspace/results /workspace/outputs && \ |
38 | | - chmod 777 /workspace /workspace/results /workspace/outputs && \ |
39 | | - /usr/local/bin/polkadot-staking-miner --version |
| 33 | +USER miner |
40 | 34 |
|
41 | | -WORKDIR /workspace |
| 35 | +ENV SEED="" |
| 36 | +ENV URI="wss://rpc.polkadot.io" |
| 37 | +ENV RUST_LOG="info" |
42 | 38 |
|
43 | | -ENTRYPOINT ["/usr/local/bin/polkadot-staking-miner"] |
44 | | -CMD ["--help"] |
| 39 | +# check if the binary works in this container |
| 40 | +RUN /usr/local/bin/polkadot-staking-miner --version |
| 41 | + |
| 42 | +ENTRYPOINT [ "/usr/local/bin/polkadot-staking-miner" ] |
0 commit comments