mirror of
https://github.com/pezkuwichain/pez-minimal-template.git
synced 2026-04-22 03:18:01 +00:00
copy from PR, run --help
This commit is contained in:
+3
-1
@@ -1 +1,3 @@
|
|||||||
**/target
|
target/
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
|||||||
@@ -28,3 +28,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Build the docker image
|
- name: Build the docker image
|
||||||
run: docker build . -t polkadot-sdk-minimal-template
|
run: docker build . -t polkadot-sdk-minimal-template
|
||||||
|
|
||||||
|
- name: Try running the container
|
||||||
|
run: docker run --rm polkadot-sdk-minimal-template --help
|
||||||
|
|||||||
+6
-8
@@ -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
|
FROM docker.io/paritytech/ci-unified:latest as builder
|
||||||
|
|
||||||
WORKDIR /polkadot
|
WORKDIR /polkadot
|
||||||
COPY . /polkadot
|
COPY . /polkadot
|
||||||
|
|
||||||
|
RUN cargo fetch
|
||||||
RUN cargo build --locked --release
|
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
|
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
|
USER root
|
||||||
|
RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \
|
||||||
RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \
|
|
||||||
mkdir -p /data /polkadot/.local/share && \
|
mkdir -p /data /polkadot/.local/share && \
|
||||||
chown -R polkadot:polkadot /data && \
|
chown -R polkadot:polkadot /data && \
|
||||||
ln -s /data /polkadot/.local/share/polkadot && \
|
ln -s /data /polkadot/.local/share/polkadot && \
|
||||||
# unclutter and minimize the attack surface
|
# unclutter and minimize the attack surface
|
||||||
rm -rf /usr/bin /usr/sbin && \
|
rm -rf /usr/bin /usr/sbin && \
|
||||||
# check if executable works in this container
|
# check if executable works in this container
|
||||||
/usr/local/bin/polkadot --version
|
/usr/local/bin/minimal-template-node --version
|
||||||
|
|
||||||
USER polkadot
|
USER polkadot
|
||||||
|
|
||||||
EXPOSE 30333 9933 9944 9615
|
EXPOSE 30333 9933 9944 9615
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/polkadot"]
|
ENTRYPOINT ["/usr/local/bin/minimal-template-node"]
|
||||||
|
|||||||
Reference in New Issue
Block a user