Skip to content

Commit

Permalink
update rust base image
Browse files Browse the repository at this point in the history
Signed-off-by: hydai <[email protected]>
  • Loading branch information
hydai committed Nov 30, 2023
1 parent c411afe commit 22d4c13
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
# syntax=docker/dockerfile:1

FROM --platform=$BUILDPLATFORM rust:1.69 AS buildbase
FROM --platform=$BUILDPLATFORM rust:1.71 AS buildbase
WORKDIR /src
RUN <<EOT bash
set -ex
apt-get update
apt-get install -y \
git \
clang
rustup target add wasm32-wasi
EOT
# This line installs WasmEdge including the AOT compiler
RUN curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash

FROM buildbase AS build
COPY Cargo.toml orders.json update_order.json .
COPY src ./src
COPY src ./src
# Build the Wasm binary
RUN cargo build --target wasm32-wasi --release
# This line builds the AOT Wasm binary
RUN /root/.wasmedge/bin/wasmedgec target/wasm32-wasi/release/order_demo_service.wasm order_demo_service.wasm
RUN cp target/wasm32-wasi/release/order_demo_service.wasm order_demo_service.wasm
RUN chmod a+x order_demo_service.wasm

FROM scratch
Expand Down

0 comments on commit 22d4c13

Please sign in to comment.