copy from PR, run --help

This commit is contained in:
rzadp
2024-05-31 09:18:21 +02:00
parent 99a6e35248
commit 972a50ca8a
3 changed files with 12 additions and 9 deletions
+3 -1
View File
@@ -1 +1,3 @@
**/target
target/
Dockerfile
.dockerignore
+3
View File
@@ -28,3 +28,6 @@ jobs:
- name: Build the docker image
run: docker build . -t polkadot-sdk-minimal-template
- name: Try running the container
run: docker run --rm polkadot-sdk-minimal-template --help
+6 -8
View File
@@ -1,30 +1,28 @@
# This is the build stage for Polkadot. Here we create the binary in a temporary image.
FROM docker.io/paritytech/ci-unified:latest as builder
WORKDIR /polkadot
COPY . /polkadot
RUN cargo fetch
RUN cargo build --locked --release
# This is the 2nd stage: a very small image where we copy the Polkadot binary."
FROM docker.io/parity/base-bin:latest
LABEL description="Multistage Docker image for Polkadot: a platform for web3"
COPY --from=builder /polkadot/target/release/minimal-template-node /usr/local/bin
COPY --from=builder /polkadot/target/release/polkadot /usr/local/bin
RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \
USER root
RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \
mkdir -p /data /polkadot/.local/share && \
chown -R polkadot:polkadot /data && \
ln -s /data /polkadot/.local/share/polkadot && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# check if executable works in this container
/usr/local/bin/polkadot --version
/usr/local/bin/minimal-template-node --version
USER polkadot
EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/polkadot"]
ENTRYPOINT ["/usr/local/bin/minimal-template-node"]