-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (22 loc) · 1.03 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# ------------------------------------------------------------------------------
# Build Stage
# ------------------------------------------------------------------------------
FROM alpine:3.16 as wasm-builder
ARG RUSTC_VERSION=1.58.1
RUN apk update \
&& apk upgrade \
&& apk add build-base binutils-gold openssl3-dev protoc curl \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- --no-modify-path --profile minimal --default-toolchain ${RUSTC_VERSION} \
-c rustfmt -t wasm32-unknown-unknown -y
WORKDIR /usr/src/wasm-builder
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
COPY src src
RUN source $HOME/.cargo/env \
&& cargo build --target=wasm32-unknown-unknown --release
# ------------------------------------------------------------------------------
# Run Stage
# ------------------------------------------------------------------------------
FROM scratch
COPY --from=wasm-shim-build /usr/src/wasm-shim/target/wasm32-unknown-unknown/release/cookie_delete_filter.wasm /plugin.wasm