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

Commit

Permalink
chore: update builder image
Browse files Browse the repository at this point in the history
fix #9765
  • Loading branch information
chevdor committed Sep 17, 2021
1 parent d268152 commit 3be3df9
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 30 deletions.
29 changes: 0 additions & 29 deletions docker/Dockerfile

This file was deleted.

3 changes: 2 additions & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ GITREPO=polkadot

# Build the image
echo "Building ${GITUSER}/${GITREPO}:latest docker image, hang on!"
time docker build -f ./docker/Dockerfile --build-arg RUSTC_WRAPPER= --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:latest .
DOCKERFILE=./docker/polkadot_builder.Dockerfile
time docker build -f $DOCKERFILE --build-arg RUSTC_WRAPPER= --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:latest .

# Show the list of available images for this repo
echo "Image is ready"
Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- "30333:30333"
- "9933:9933"
- "9944:9944"
- "9615:9615"
image: chevdor/polkadot:latest
volumes:
- "polkadot-data-alice:/data"
Expand All @@ -22,6 +23,7 @@ services:
- "30344:30344"
- "9935:9935"
- "9945:9945"
- "9615:9615"
image: chevdor/polkadot:latest
volumes:
- "polkadot-data-bob:/data"
Expand Down
42 changes: 42 additions & 0 deletions docker/polkadot_builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This is the build stage for Polkadot. Here we create the binary in a temporary image.
FROM docker.io/paritytech/ci-linux:production as builder

ARG PROFILE=release

WORKDIR /polkadot

COPY . /polkadot

RUN cargo build --locked --$PROFILE


# This is the 2nd stage: a very small image where we copy the Polkadot binary."
FROM docker.io/library/ubuntu:20.04

LABEL description="Multistage Docker image for Polkadot: a platform for web3" \
io.parity.image.type="builder" \
io.parity.image.authors="[email protected], [email protected]" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.description="Polkadot: a platform for web3" \
io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/docker/Dockerfile" \
io.parity.image.documentation="https://github.com/paritytech/polkadot/"

ARG PROFILE=release

COPY --from=builder /polkadot/target/$PROFILE/polkadot /usr/local/bin

RUN useradd -m -u 1000 -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 && \
rm -rf /usr/bin /usr/sbin

USER polkadot

# check if executable works in this container
RUN /usr/bin/polkadot --version

EXPOSE 30333 9933 9944 9615
VOLUME ["/polkadot"]

ENTRYPOINT ["/usr/local/bin/polkadot"]

0 comments on commit 3be3df9

Please sign in to comment.