forked from bandprotocol/bandchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.linux
43 lines (32 loc) · 1.04 KB
/
Dockerfile.linux
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 centos:centos7
RUN yum -y update
RUN yum -y install clang gcc gcc-c++ make wget
# GET FROM https://github.com/rust-lang/docker-rust-nightly
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN url="https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init"; \
wget "$url"; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-toolchain nightly-2020-06-08; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;
# PRE-FETCH MANY DEPS
WORKDIR /scratch
COPY owasm /scratch/owasm
COPY go-owasm /scratch/go-owasm
RUN cd go-owasm && cargo fetch
# allow non-root user to download more deps later
RUN chmod -R 777 /usr/local/cargo
## COPY BUILD SCRIPTS
WORKDIR /code
RUN rm -rf /scratch
COPY go-owasm/build/build_linux.sh /opt
RUN chmod +x /opt/build*
RUN mkdir /.cargo
RUN chmod +rx /.cargo
COPY go-owasm/build/cargo-config /.cargo/config
CMD ["/opt/build_linux.sh"]