-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1471 from luca992/patch-3
secret-contract-optimizer: support multiple contracts
- Loading branch information
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
11 changes: 9 additions & 2 deletions
11
deployment/dockerfiles/base-images/secret-contract-optimizer.Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
FROM rust:1.68.0-slim-bullseye | ||
FROM rust:1.69.0-slim-bullseye | ||
|
||
RUN rustup target add wasm32-unknown-unknown | ||
RUN apt update && apt install -y binaryen clang && rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /contract | ||
|
||
ENTRYPOINT ["/bin/bash", "-c", "RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked && wasm-opt -Oz ./target/wasm32-unknown-unknown/release/*.wasm -o ./contract.wasm && cat ./contract.wasm | gzip -n -9 > ./contract.wasm.gz && rm -f ./contract.wasm"] | ||
ENTRYPOINT ["/bin/bash", "-c", "\ | ||
RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked && \ | ||
(mkdir -p ./optimized-wasm/ && rm -f ./optimized-wasm/* && cp ./target/wasm32-unknown-unknown/release/*.wasm ./optimized-wasm/) && \ | ||
for w in ./optimized-wasm/*.wasm; do \ | ||
wasm-opt -Oz $w -o $w ; \ | ||
done && \ | ||
(cd ./optimized-wasm && gzip -n -9 -f *) \ | ||
"] |