forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfiles to the templates (paritytech#4637)
As requested [here](paritytech#3155 (comment)). The Dockerfiles are inspired by [this one](https://github.com/paritytech/polkadot-sdk/blob/aa32faaebf64426becb2feeede347740eb7a3908/docker/dockerfiles/polkadot/polkadot_builder.Dockerfile).
- Loading branch information
1 parent
f3c177a
commit 3900554
Showing
6 changed files
with
93 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
target/ | ||
Dockerfile | ||
.dockerignore |
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,28 @@ | ||
FROM docker.io/paritytech/ci-unified:latest as builder | ||
|
||
WORKDIR /polkadot | ||
COPY . /polkadot | ||
|
||
RUN cargo fetch | ||
RUN cargo build --locked --release | ||
|
||
FROM docker.io/parity/base-bin:latest | ||
|
||
COPY --from=builder /polkadot/target/release/minimal-template-node /usr/local/bin | ||
|
||
USER root | ||
RUN useradd -m -u 1001 -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 && \ | ||
# unclutter and minimize the attack surface | ||
rm -rf /usr/bin /usr/sbin && \ | ||
# check if executable works in this container | ||
/usr/local/bin/minimal-template-node --version | ||
|
||
USER polkadot | ||
|
||
EXPOSE 30333 9933 9944 9615 | ||
VOLUME ["/data"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/minimal-template-node"] |
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,3 @@ | ||
target/ | ||
Dockerfile | ||
.dockerignore |
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,28 @@ | ||
FROM docker.io/paritytech/ci-unified:latest as builder | ||
|
||
WORKDIR /polkadot | ||
COPY . /polkadot | ||
|
||
RUN cargo fetch | ||
RUN cargo build --locked --release | ||
|
||
FROM docker.io/parity/base-bin:latest | ||
|
||
COPY --from=builder /polkadot/target/release/parachain-template-node /usr/local/bin | ||
|
||
USER root | ||
RUN useradd -m -u 1001 -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 && \ | ||
# unclutter and minimize the attack surface | ||
rm -rf /usr/bin /usr/sbin && \ | ||
# check if executable works in this container | ||
/usr/local/bin/parachain-template-node --version | ||
|
||
USER polkadot | ||
|
||
EXPOSE 30333 9933 9944 9615 | ||
VOLUME ["/data"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/parachain-template-node"] |
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,3 @@ | ||
target/ | ||
Dockerfile | ||
.dockerignore |
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,28 @@ | ||
FROM docker.io/paritytech/ci-unified:latest as builder | ||
|
||
WORKDIR /polkadot | ||
COPY . /polkadot | ||
|
||
RUN cargo fetch | ||
RUN cargo build --locked --release | ||
|
||
FROM docker.io/parity/base-bin:latest | ||
|
||
COPY --from=builder /polkadot/target/release/solochain-template-node /usr/local/bin | ||
|
||
USER root | ||
RUN useradd -m -u 1001 -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 && \ | ||
# unclutter and minimize the attack surface | ||
rm -rf /usr/bin /usr/sbin && \ | ||
# check if executable works in this container | ||
/usr/local/bin/solochain-template-node --version | ||
|
||
USER polkadot | ||
|
||
EXPOSE 30333 9933 9944 9615 | ||
VOLUME ["/data"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/solochain-template-node"] |