mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 00:41:59 +00:00
These two are currently always re-built on every run. We don't need `wasm-opt` if we build the WASM in debug mode and we can install `wasm-pack` by downloading it from a URL. Pull-Request: #4497.
29 lines
1.1 KiB
Docker
29 lines
1.1 KiB
Docker
FROM rust:1.67.0 as builder
|
|
|
|
# Run with access to the target cache to speed up builds
|
|
WORKDIR /workspace
|
|
ADD . .
|
|
|
|
RUN rustup target add wasm32-unknown-unknown
|
|
|
|
RUN wget -q -O- https://github.com/rustwasm/wasm-pack/releases/download/v0.12.1/wasm-pack-v0.12.1-x86_64-unknown-linux-musl.tar.gz | tar -zx -C /usr/local/bin --strip-components 1 --wildcards "wasm-pack-*/wasm-pack"
|
|
RUN wget -q -O- https://github.com/WebAssembly/binaryen/releases/download/version_115/binaryen-version_115-x86_64-linux.tar.gz | tar -zx -C /usr/local/bin --strip-components 2 --wildcards "binaryen-version_*/bin/wasm-opt"
|
|
|
|
RUN --mount=type=cache,target=./target \
|
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
|
wasm-pack build --target web interop-tests
|
|
|
|
RUN --mount=type=cache,target=./target \
|
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
|
cargo build --release --package interop-tests --bin wasm_ping
|
|
|
|
RUN --mount=type=cache,target=./target \
|
|
mv ./target/release/wasm_ping /usr/local/bin/testplan
|
|
|
|
FROM selenium/standalone-chrome:115.0
|
|
COPY --from=builder /usr/local/bin/testplan /usr/local/bin/testplan
|
|
|
|
ENV RUST_BACKTRACE=1
|
|
|
|
ENTRYPOINT ["testplan"]
|