Skip to content

Commit ab5be9d

Browse files
authored
Merge pull request #36 from CosmWasm/pre-compiled-sccache
Download `sccache` binary instead of building it
2 parents b718d14 + 9b015e2 commit ab5be9d

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

rust-optimizer.Dockerfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ FROM rust:1.51.0
44
# setup rust with Wasm support
55
RUN rustup target add wasm32-unknown-unknown
66

7-
# Install sccache from https://crates.io/crates/sccache
8-
# This is slow due to full release compilation from source.
9-
# Use full version string here to ensure Docker caching works well.
10-
RUN cargo install --version 0.2.15 sccache
7+
# Download sccache and verify checksum
8+
ADD https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz /tmp/sccache.tar.gz
9+
RUN sha256sum /tmp/sccache.tar.gz | grep e5d03a9aa3b9fac7e490391bbe22d4f42c840d31ef9eaf127a03101930cbb7ca
10+
11+
# Extract and install sccache
12+
RUN tar -xf /tmp/sccache.tar.gz
13+
RUN mv sccache-v*/sccache /usr/local/bin/sccache
14+
RUN chmod +x /usr/local/bin/sccache
15+
RUN rm -rf sccache-v*/ /tmp/sccache.tar.gz
16+
17+
# Check sccache version
18+
RUN sccache --version
1119

1220
# Download binaryen and verify checksum
1321
ADD https://github.com/WebAssembly/binaryen/releases/download/version_96/binaryen-version_96-x86_64-linux.tar.gz /tmp/binaryen.tar.gz
@@ -16,6 +24,7 @@ RUN sha256sum /tmp/binaryen.tar.gz | grep 9f8397a12931df577b244a27c293d7c976bc7e
1624
# Extract and install wasm-opt
1725
RUN tar -xf /tmp/binaryen.tar.gz --wildcards '*/wasm-opt'
1826
RUN mv binaryen-version_*/wasm-opt /usr/local/bin
27+
RUN rm -rf binaryen-version_*/ /tmp/binaryen.tar.gz
1928

2029
# Check wasm-opt version
2130
RUN wasm-opt --version

workspace-optimizer.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ RUN sha256sum /tmp/binaryen.tar.gz | grep 9f8397a12931df577b244a27c293d7c976bc7e
2323
# Extract and install wasm-opt
2424
RUN tar -xf /tmp/binaryen.tar.gz --wildcards '*/wasm-opt'
2525
RUN mv binaryen-version_*/wasm-opt /usr/local/bin
26+
RUN rm -rf binaryen-version_*/ /tmp/binaryen.tar.gz
2627

2728
# Check wasm-opt version
2829
RUN wasm-opt --version

0 commit comments

Comments
 (0)