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

Commit c367862

Browse files
chevdorTriplEight
andauthored
Update docker/substrate_builder.Dockerfile
Co-authored-by: Denis Pisarev <[email protected]>
1 parent 40c529e commit c367862

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

docker/substrate_builder.Dockerfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,21 @@ LABEL description="Multistage Docker image for Substrate: a platform for web3" \
1515
io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/docker/substrate_builder.Dockerfile" \
1616
io.parity.image.documentation="https://github.com/paritytech/polkadot/"
1717

18-
RUN useradd -m -u 1000 -U -s /bin/sh -d /substrate substrate && \
19-
mkdir -p /data /substrate/.local/share/substrate && \
20-
chown -R substrate:substrate /data && \
21-
ln -s /data /substrate/.local/share/substrate
22-
2318
COPY --from=builder /substrate/target/release/substrate /usr/local/bin
2419
COPY --from=builder /substrate/target/release/subkey /usr/local/bin
2520
COPY --from=builder /substrate/target/release/node-template /usr/local/bin
2621
COPY --from=builder /substrate/target/release/chain-spec-builder /usr/local/bin
2722

23+
RUN useradd -m -u 1000 -U -s /bin/sh -d /substrate substrate && \
24+
mkdir -p /data /substrate/.local/share/substrate && \
25+
chown -R substrate:substrate /data && \
26+
ln -s /data /substrate/.local/share/substrate && \
27+
# unclutter and minimize the attack surface
28+
rm -rf /usr/bin /usr/sbin && \
2829
# Sanity checks
29-
RUN ldd /usr/local/bin/substrate && \
30+
ldd /usr/local/bin/substrate && \
3031
/usr/local/bin/substrate --version
3132

32-
# Remove whatever not required
33-
RUN rm -rf /usr/bin /usr/sbin
34-
3533
USER substrate
3634
EXPOSE 30333 9933 9944 9615
3735
VOLUME ["/data"]

0 commit comments

Comments
 (0)