Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wasm.Dockerfile #4

Merged
merged 2 commits into from
Aug 24, 2023
Merged

add wasm.Dockerfile #4

merged 2 commits into from
Aug 24, 2023

Conversation

cataggar
Copy link
Owner

@cataggar cataggar commented Aug 24, 2023

Here is how to build and run using Wasmtime https://wasmtime.dev/ and Docker https://docs.docker.com/desktop/wasm/ . Since it is I/O bound, it takes 24 seconds on Docker for Windows and 1.6 seconds under Wasmtime.

cargo install cargo-wasi
cargo wasi build --release
winget install BytecodeAlliance.Wasmtime
wasmtime run --dir $EV2 target\wasm32-wasi\release\configur.wasm -- config $EV2/environments $EV2/scratch
docker buildx build --platform wasi/wasm --provenance=false -f wasm.Dockerfile -t $REGISTRY/cataggar/configur.wasm .

Due to bug, --provenance=false is temporarily required.

docker run --platform=wasi/wasm --runtime=io.containerd.wasmtime.v1 --rm -v ${EV2}:/ev2 $REGISTRY/cataggar/configur.wasm config /ev2/environments /ev2/scratch

@cataggar cataggar merged commit bd1a2d3 into main Aug 24, 2023
@cataggar cataggar deleted the wasm branch August 24, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants