Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM rust:1.69.0
LABEL description="Linear contract builder"

RUN apt-get update && apt-get install -y git less vim clang

RUN rustup default 1.69.0
RUN rustup target add wasm32-unknown-unknown

# Cargo files are needed to install and cache dependencies
ADD contracts/linear/Cargo.toml .
ADD Cargo.lock .

# a trick to run cargo build
RUN mkdir -p src && echo "fn main() {}" > src/lib.rs && \
RUSTFLAGS="-C link-arg=-s" cargo build -p linear --target wasm32-unknown-unknown --release && \
rm Cargo.toml && \
rm -rf ./src/ target/release/deps/my-project* target/release/my-project*
29 changes: 0 additions & 29 deletions build_docker.sh

This file was deleted.

10 changes: 10 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ mock-whitelist: contracts/mock-whitelist
mkdir -p res
cp target/wasm32-unknown-unknown/release/mock_whitelist.wasm ./res/mock_whitelist.wasm

docker:
docker build -t linear-builder .
docker run \
--mount type=bind,source=${PWD},target=/host \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
-w /host \
-e RUSTFLAGS=$(RFLAGS) \
-i -t linear-builder \
make

clean:
rm res/*.wasm

Expand Down
Loading