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

Commit

Permalink
Update docker/substrate_builder.Dockerfile
Browse files Browse the repository at this point in the history
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
  • Loading branch information
chevdor and TriplEight committed Oct 4, 2021
1 parent 48ae205 commit 787378b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions docker/substrate_builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,21 @@ LABEL description="Multistage Docker image for Substrate: a platform for web3" \
io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/docker/substrate_builder.Dockerfile" \
io.parity.image.documentation="https://github.com/paritytech/polkadot/"

RUN useradd -m -u 1000 -U -s /bin/sh -d /substrate substrate && \
mkdir -p /data /substrate/.local/share/substrate && \
chown -R substrate:substrate /data && \
ln -s /data /substrate/.local/share/substrate

COPY --from=builder /substrate/target/release/substrate /usr/local/bin
COPY --from=builder /substrate/target/release/subkey /usr/local/bin
COPY --from=builder /substrate/target/release/node-template /usr/local/bin
COPY --from=builder /substrate/target/release/chain-spec-builder /usr/local/bin

RUN useradd -m -u 1000 -U -s /bin/sh -d /substrate substrate && \
mkdir -p /data /substrate/.local/share/substrate && \
chown -R substrate:substrate /data && \
ln -s /data /substrate/.local/share/substrate && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# Sanity checks
RUN ldd /usr/local/bin/substrate && \
ldd /usr/local/bin/substrate && \
/usr/local/bin/substrate --version

# Remove whatever not required
RUN rm -rf /usr/bin /usr/sbin

USER substrate
EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]

0 comments on commit 787378b

Please sign in to comment.