This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (49 loc) · 1.67 KB
/
Makefile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Workaround for https://github.com/moby/buildkit/issues/3891
export BUILDX_NO_DEFAULT_ATTESTATIONS = 1
# Build a container image for the demo
.PHONY: image
image:
docker build --platform wasi/wasm --tag=wws-apps:latest .
# Export the content of the demo image into the ./dist folder
.PHONY: dist
dist: clean
docker build --platform wasi/wasm --output=dist .
# Run the demo container
.PHONY: run
run: stop image
docker run --rm -d --name docker-wws \
-p 3000:3000 \
--runtime=io.containerd.wws.v1 \
--platform=wasi/wasm \
wws-apps:latest
@echo "Now you can reach the Wasm Workers Server functions, such as:"
@echo " - curl http://localhost:3000/user-generation-rust"
@echo " - curl http://localhost:3000/user-generation-go"
@echo " - curl http://localhost:3000/user-generation-js"
@echo " - curl http://localhost:3000/user-generation-python"
@echo " - curl http://localhost:3000/user-generation-ruby"
# Run the demo container using a host mount
.PHONY: run-with-mount
run-with-mount: stop image
docker run --rm -d --name docker-wws \
-p 3000:3000 \
--runtime=io.containerd.wws.v1 \
--platform=wasi/wasm \
-v $(PWD)/tmp:/tmp \
wws-apps:latest
@echo "Now you can reach the Wasm Workers Server functions, such as:"
@echo " - curl http://localhost:3000/user-generation-rust"
@echo " - curl http://localhost:3000/user-generation-go"
@echo " - curl http://localhost:3000/user-generation-js"
@echo " - curl http://localhost:3000/user-generation-python"
@echo " - curl http://localhost:3000/user-generation-ruby"
# Stop the demo contianer
.PHONY: stop
stop:
docker rm -f docker-wws
# Same as dist
.PHONY: build
build: dist;
.PHONY: clean
clean:
rm -Rf ./dist