This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dockerfiles: polkadot-collator_builder.Containerfile and docs * dockerfiles: optimize test dockerfile
- Loading branch information
1 parent
d4045c8
commit 7100363
Showing
3 changed files
with
60 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file is sourced from https://github.com/paritytech/polkadot/blob/master/scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile | ||
# This is the build stage for Polkadot-collator. Here we create the binary in a temporary image. | ||
FROM docker.io/paritytech/ci-linux:production as builder | ||
|
||
WORKDIR /cumulus | ||
COPY . /cumulus | ||
|
||
RUN cargo build --release --locked -p polkadot-collator | ||
|
||
# This is the 2nd stage: a very small image where we copy the Polkadot binary." | ||
FROM docker.io/library/ubuntu:20.04 | ||
|
||
LABEL io.parity.image.type="builder" \ | ||
io.parity.image.authors="[email protected]" \ | ||
io.parity.image.vendor="Parity Technologies" \ | ||
io.parity.image.description="Multistage Docker image for Polkadot-collator" \ | ||
io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/docker/test-parachain-collator.dockerfile" \ | ||
io.parity.image.documentation="https://github.com/paritytech/cumulus" | ||
|
||
COPY --from=builder /cumulus/target/release/polkadot-collator /usr/local/bin | ||
|
||
RUN useradd -m -u 1000 -U -s /bin/sh -d /cumulus polkadot-collator && \ | ||
mkdir -p /data /cumulus/.local/share && \ | ||
chown -R polkadot-collator:polkadot-collator /data && \ | ||
ln -s /data /cumulus/.local/share/polkadot-collator && \ | ||
# unclutter and minimize the attack surface | ||
rm -rf /usr/bin /usr/sbin && \ | ||
# check if executable works in this container | ||
/usr/local/bin/polkadot-collator --version | ||
|
||
USER polkadot-collator | ||
|
||
EXPOSE 30333 9933 9944 9615 | ||
VOLUME ["/data"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/polkadot-collator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters