forked from Phala-Network/phala-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hw.Dockerfile
68 lines (53 loc) · 1.67 KB
/
hw.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND='noninteractive'
ADD dockerfile.d/01_apt.sh /root
RUN bash /root/01_apt.sh
ADD ./dockerfile.d/03_sdk.sh /root
RUN bash /root/03_sdk.sh
ARG CODENAME='bionic'
ARG VERSION='2.11.100.2-bionic1'
ADD ./dockerfile.d/04_psw.sh /root
RUN bash /root/04_psw.sh
ARG RUST_TOOLCHAIN='nightly-2020-09-27'
ADD ./dockerfile.d/05_rust.sh /root
RUN bash /root/05_rust.sh
ADD ./dockerfile.d/06_wasm.sh /root
RUN bash /root/06_wasm.sh
WORKDIR /root
# ====== build phala ======
RUN mkdir phala-blockchain
ADD . phala-blockchain
RUN mkdir prebuilt
RUN cd phala-blockchain && \
PATH="$PATH:$HOME/.cargo/bin" cargo build --release && \
cp ./target/release/phost /root/prebuilt && \
cp ./target/release/phala-node /root/prebuilt && \
PATH="$PATH:$HOME/.cargo/bin" cargo clean && \
rm -rf /root/.cargo/registry && \
rm -rf /root/.cargo/git
ARG IAS_SPID=''
ARG IAS_API_KEY=''
ARG IAS_ENV='DEV'
ARG SGX_SIGN_KEY_URL=''
ARG SGX_ENCLAVE_CONFIG_URL=''
RUN cd phala-blockchain/pruntime && \
PATH="$PATH:$HOME/.cargo/bin" SGX_SDK="/opt/sgxsdk" SGX_MODE=HW make && \
cp ./bin/app /root/prebuilt && \
cp ./bin/enclave.signed.so /root/prebuilt && \
cp ./bin/Rocket.toml /root/prebuilt && \
PATH="$PATH:$HOME/.cargo/bin" make clean && \
rm -rf /root/.cargo/registry && \
rm -rf /root/.cargo/git
# ====== clean up ======
RUN rm -rf phala-blockchain
ADD dockerfile.d/cleanup.sh .
RUN bash cleanup.sh
# ====== start phala ======
ADD dockerfile.d/console.sh ./console.sh
ADD dockerfile.d/startup.hw.sh ./startup.sh
ADD dockerfile.d/api.nginx.conf /etc/nginx/sites-enabled/default
CMD bash ./startup.sh
EXPOSE 8000
EXPOSE 9933
EXPOSE 9944
EXPOSE 30333