-
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.
- Loading branch information
Showing
3 changed files
with
66 additions
and
6 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
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,60 @@ | ||
FROM ubuntu:20.04 AS builder | ||
|
||
ARG DEBIAN_FRONTEND='noninteractive' | ||
ARG RUST_TOOLCHAIN='nightly-2022-04-01' | ||
ARG PHALA_GIT_REPO='https://github.com/Phala-Network/khala-parachain.git' | ||
ARG PHALA_GIT_TAG='master' | ||
|
||
WORKDIR /root | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y apt-utils apt-transport-https software-properties-common readline-common curl vim wget gnupg gnupg2 gnupg-agent ca-certificates cmake pkg-config libssl-dev git build-essential llvm clang libclang-dev | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain="${RUST_TOOLCHAIN}" && \ | ||
$HOME/.cargo/bin/rustup target add wasm32-unknown-unknown --toolchain "${RUST_TOOLCHAIN}" | ||
|
||
RUN echo "Compiling Khala from $PHALA_GIT_REPO:$PHALA_GIT_TAG..." && \ | ||
git clone --depth 1 --recurse-submodules --shallow-submodules -j 8 -b ${PHALA_GIT_TAG} ${PHALA_GIT_REPO} khala-parachain && \ | ||
cd khala-parachain && \ | ||
PATH="$HOME/.cargo/bin:$PATH" cargo build --profile production && \ | ||
cp ./target/production/khala-node /root && \ | ||
PATH="$HOME/.cargo/bin:$PATH" cargo clean && \ | ||
rm -rf /root/.cargo/registry && \ | ||
rm -rf /root/.cargo/git | ||
|
||
# ==== | ||
|
||
FROM ubuntu:20.04 | ||
|
||
ARG DEBIAN_FRONTEND='noninteractive' | ||
|
||
WORKDIR /root | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y apt-utils apt-transport-https software-properties-common readline-common curl vim wget gnupg gnupg2 gnupg-agent ca-certificates tini | ||
|
||
COPY --from=builder /root/khala-node /usr/local/bin/khala-node | ||
ADD dockerfile.d/start_node.sh ./start_node.sh | ||
|
||
ENV RUST_LOG="info" | ||
ENV NODE_NAME="phala-node" | ||
ENV NODE_ROLE="ARCHIVE" | ||
|
||
ENV PARACHAIN="phala" | ||
ENV RELAYCHAIN="polkadot" | ||
|
||
ENV PARACHAIN_EXTRA_ARGS="" | ||
ENV RELAYCHAIN_EXTRA_ARGS="" | ||
|
||
EXPOSE 9615 | ||
EXPOSE 9616 | ||
EXPOSE 9933 | ||
EXPOSE 9934 | ||
EXPOSE 9944 | ||
EXPOSE 9945 | ||
EXPOSE 30333 | ||
EXPOSE 30334 | ||
|
||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
|
||
CMD ["/bin/bash", "./start_node.sh"] |