-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile
43 lines (33 loc) · 1.39 KB
/
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
FROM phusion/baseimage:0.11 as builder
LABEL maintainer="[email protected]"
LABEL description="This is the build stage for Zerochain. Here we create the binary."
ARG PROFILE=release
WORKDIR /zerochain
COPY . /zerochain
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y cmake pkg-config libssl-dev git clang
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="$PATH:$HOME/.cargo/bin" && \
rustup toolchain install nightly && \
rustup target add wasm32-unknown-unknown --toolchain nightly && \
cargo install --git https://github.com/alexcrichton/wasm-gc && \
rustup default nightly && \
./build.sh && \
rustup default stable && \
cargo build --$PROFILE --all
# ===== SECOND STAGE ======
FROM phusion/baseimage:0.11
LABEL maintainer="[email protected]"
LABEL description="This is the 2nd stage: a very small image where we copy the Zerochain binary."
ARG PROFILE=release
COPY --from=builder /zerochain/target/$PROFILE/zerochain /usr/local/bin
COPY --from=builder /zerochain/zface/params/conf_vk.dat /usr/local/bin/zface/conf_vk.dat
COPY --from=builder /zerochain/zface/params/anony_vk.dat /usr/local/bin/zface/anony_vk.dat
RUN rm -rf /usr/lib/python* && \
mkdir -p /root/.local/share && \
ln -s /root/.local/share /data
EXPOSE 30333 9933 9944
VOLUME ["/data"]
WORKDIR /usr/local/bin
CMD ["zerochain", "--dev", "--ws-external"]