Skip to content

Commit

Permalink
Merge pull request #1471 from luca992/patch-3
Browse files Browse the repository at this point in the history
secret-contract-optimizer: support multiple contracts
  • Loading branch information
assafmo authored Jul 4, 2023
2 parents 07ff317 + 64e65f4 commit 6d61b3c
Showing 1 changed file with 9 additions and 2 deletions.
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 *) \
"]

0 comments on commit 6d61b3c

Please sign in to comment.