-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile
27 lines (22 loc) · 753 Bytes
/
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
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM rust:1.71 AS buildbase
WORKDIR /src
RUN apt-get update && apt-get install -y --no-install-recommends \
clang \
&& rm -rf /var/lib/apt/lists/*
RUN <<EOT bash
set -ex
rustup target add wasm32-wasi
EOT
FROM buildbase AS build
COPY Cargo.toml orders.json update_order.json ./
COPY src ./src
COPY .cargo ./.cargo
# Build the Wasm binary
RUN cargo build --target wasm32-wasi --release
# This line builds the AOT Wasm binary
RUN cp target/wasm32-wasi/release/order_demo_service.wasm order_demo_service.wasm
RUN chmod a+x order_demo_service.wasm
FROM scratch
ENTRYPOINT [ "/order_demo_service.wasm" ]
COPY --link --from=build /src/order_demo_service.wasm /order_demo_service.wasm