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 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script and dockerfile to build an injected docker image for the p…
…olkadot-collator binary (#591) * remove exec flag on json file * fix dockerignore filter to allow building the injected docker image * Update docker/injected.Dockerfile * Update docker/scripts/build-injected-image.sh Co-authored-by: Martin Pugh <[email protected]> Co-authored-by: Denis Pisarev <[email protected]>
- Loading branch information
1 parent
968c91e
commit bf4024f
Showing
6 changed files
with
71 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
**/*.txt | ||
**/*.md | ||
/docker/ | ||
!/target/release/polkadot-collator | ||
|
||
# dotfiles in the repo root | ||
/.* |
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,49 @@ | ||
FROM docker.io/library/debian:buster-slim | ||
|
||
# metadata | ||
ARG VCS_REF | ||
ARG BUILD_DATE | ||
ARG IMAGE_NAME | ||
|
||
LABEL io.parity.image.authors="[email protected]" \ | ||
io.parity.image.vendor="Parity Technologies" \ | ||
io.parity.image.title="${IMAGE_NAME}" \ | ||
io.parity.image.description="polkadot: a platform for web3" \ | ||
io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/Dockerfile" \ | ||
io.parity.image.revision="${VCS_REF}" \ | ||
io.parity.image.created="${BUILD_DATE}" \ | ||
io.parity.image.documentation="https://github.com/paritytech/cumulus/" | ||
|
||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
|
||
# install tools and dependencies | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
libssl1.1 \ | ||
ca-certificates \ | ||
curl && \ | ||
# apt cleanup | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
find /var/lib/apt/lists/ -type f -not -name lock -delete; \ | ||
# add user and link ~/.local/share/polkadot to /data | ||
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 && \ | ||
mkdir -p /specs | ||
|
||
# add polkadot-collator binary to the docker image | ||
COPY ./target/release/polkadot-collator /usr/local/bin | ||
COPY ./polkadot-parachains/res/*.json /specs/ | ||
|
||
USER polkadot | ||
|
||
# check if executable works in this container | ||
RUN /usr/local/bin/polkadot-collator --version | ||
|
||
EXPOSE 30333 9933 9944 | ||
VOLUME ["/polkadot"] | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
OWNER=parity | ||
IMAGE_NAME=polkadot-collator | ||
docker build --no-cache --build-arg IMAGE_NAME=$IMAGE_NAME -t $OWNER/$IMAGE_NAME -f ./docker/injected.Dockerfile . | ||
docker images | grep $IMAGE_NAME |
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
Empty file.