forked from ChorusOne/wormhole
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 1.41 KB
/
Dockerfile
File metadata and controls
52 lines (37 loc) · 1.41 KB
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
# Note: We don't use Alpine and its packaged Rust/Cargo because they're too often out of date,
# preventing them from being used to build Substrate/Polkadot.
FROM phusion/baseimage:0.10.2 as builder
ENV DEBIAN_FRONTEND=noninteractive
ENV RUST_TOOLCHAIN=nightly-2020-11-16
ARG PROFILE=release
WORKDIR /wormhole
COPY . /wormhole
RUN apt-get update && \
apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \
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 $RUST_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN && \
rustup default stable && \
rustup default $RUST_TOOLCHAIN
RUN export PATH="$PATH:$HOME/.cargo/bin" && cargo build "--$PROFILE" -j3
# ===== SECOND STAGE ======
FROM phusion/baseimage:0.10.2
ARG PROFILE=release
RUN mv /usr/share/ca* /tmp && \
rm -rf /usr/share/* && \
mv /tmp/ca-certificates /usr/share/ && \
mkdir -p /root/.local/share/wormhole && \
ln -s /root/.local/share/wormhole /data
COPY --from=builder /wormhole/target/$PROFILE/wormhole /usr/local/bin
# checks
RUN ldd /usr/local/bin/wormhole && \
/usr/local/bin/wormhole --version
# Shrinking
RUN rm -rf /usr/lib/python* && \
rm -rf /usr/bin /usr/sbin /usr/share/man
# USER wormhole # see above
EXPOSE 30333 9933 9944
VOLUME ["/data"]
CMD ["/usr/local/bin/wormhole"]