-
Notifications
You must be signed in to change notification settings - Fork 3
/
node-bin.Dockerfile
44 lines (30 loc) · 1.64 KB
/
node-bin.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM ubuntu:22.04 AS builder
ARG RUST_TOOLCHAIN='1.73.0'
ARG CARGO_PROFILE='production'
ARG PHALA_GIT_REPO='https://github.com/Phala-Network/khala-parachain.git'
ARG PHALA_GIT_TAG='main'
WORKDIR /root
RUN apt-get update && \
DEBIAN_FRONTEND='noninteractive' 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 rsync libboost-all-dev zlib1g-dev miniupnpc protobuf-compiler
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 $CARGO_PROFILE && \
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:22.04
WORKDIR /root
RUN apt-get update && \
DEBIAN_FRONTEND='noninteractive' 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
ENV RUST_LOG="info"
EXPOSE 9615 9616
EXPOSE 9944 9945
EXPOSE 30333 30334
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/khala-node"]