forked from Phala-Network/phala-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sw.Dockerfile
59 lines (44 loc) · 1.45 KB
/
sw.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
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 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
RUN cd phala-blockchain/pruntime && \
PATH="$PATH:$HOME/.cargo/bin" SGX_SDK="/opt/sgxsdk" SGX_MODE=SW 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.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