forked from icon-project/IBC-Integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.DockerfileContractBuilder
45 lines (40 loc) · 1.72 KB
/
.DockerfileContractBuilder
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
FROM adoptopenjdk/openjdk11
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:/opt/binaryen/bin:$PATH \
RUST_VERSION=1.69.0
RUN set -eux; \
apt update; \
apt-get install -y --no-install-recommends \
git bash \
ca-certificates \
gcc \
libc6-dev \
; \
BINARYEN_VERS=110; \
BINARYEN_URL="https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERS}/binaryen-version_${BINARYEN_VERS}-x86_64-linux.tar.gz";\
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
aarch64|arm64)rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \
amd64|x86_64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db' ;; \
*) echo >&2 "unsupported architecture: ARCH"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \
curl -LfsSo /tmp/rustup-init ${url}; \
curl -LfsSo /tmp/binaryen.tar.gz ${BINARYEN_URL}; \
cd /tmp; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version; \
rustup component add clippy rustfmt;\
mkdir -p /opt/binaryen; \
cd /opt/binaryen; \
tar -xf /tmp/binaryen.tar.gz --strip-components=1; \
rm -rf /tmp/binaryen.tar.gz; \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace