Skip to content

Commit

Permalink
Polkadot 0.9.31
Browse files Browse the repository at this point in the history
* Polkadot `0.9.31`
* Distroless Debian 11
* Rust `1.65`
  • Loading branch information
rblaine95 committed Nov 4, 2022
1 parent e105b1b commit 3c0ec5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###################
# --- builder --- #
###################
FROM docker.io/rust:1.64 AS builder
FROM docker.io/rust:1.65 AS builder

RUN apt-get update && \
apt-get -y dist-upgrade && \
Expand All @@ -11,7 +11,7 @@ RUN apt-get update && \
protobuf-compiler

WORKDIR /opt
ARG VERSION=0.9.30
ARG VERSION=0.9.31
RUN git clone https://github.com/paritytech/polkadot.git -b v$VERSION --depth 1
WORKDIR /opt/polkadot
RUN ./scripts/init.sh
Expand All @@ -20,12 +20,14 @@ RUN cargo build --release
##################
# --- runner --- #
##################
FROM gcr.io/distroless/cc
FROM debian:11

COPY --from=builder /opt/polkadot/target/release/polkadot /usr/local/bin/polkadot

USER nonroot
WORKDIR /home/nonroot
RUN addgroup --gid 65532 nonroot \
&& adduser --system --uid 65532 --gid 65532 --home /home/nonroot nonroot

USER 65532
EXPOSE 30333 9933 9944
VOLUME /data

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ docker run \
--base-path=/data ${EXTRA_POLKADOT_ARGS}
```

### Distroless nonroot
This image uses a [Distroless](https://github.com/GoogleContainerTools/distroless) base image and runs as a nonroot user.
### Nonroot
The nonroot user has a U/GID of `65532`.
If you are having IO permission issues then make sure that the persistent volume has permissions set to allow this user Read/Write access.
If using [Podman](https://podman.io/) - `podman unshare chown -R 65532:65532 /path/to/polkadot/storage`
Expand Down

0 comments on commit 3c0ec5b

Please sign in to comment.