Simplism Builder is a Docker Compose project bringing all the necessary tools to build WASM Extism plug-ins for Simplism.
Simplism Builder comes with:
- GoLang compiler
- Tinygo compiler
- Rustc and Cargo
- Simplism executable
That means you don't need to install anything (except Docker) to build wasm plug-ins on your computer.
git clone this repository
Start the builder:
docker compose --env-file arm64.env up -d
# docker compose --env-file amd64.env up -d
- ✋ if you are on a arm architecture (mac silicon or linux arm) use
arm64.env
- otherwise use
amd64.env
If you updated ./.docker/Dockerfile
or get a new version of this project, run this command before starting the builder:
docker compose --env-file arm64.env build
# docker compose --env-file amd64.env build
Stop the builder:
docker compose --env-file arm64.env down
# docker compose --env-file amd64.env down
Once the builder started, you can use it like this:
docker exec --workdir /workspace -it simplism-builder /bin/bash
Now you can build Extism plug-ins for Simplism. Try this:
simplism generate go hello-world .
cd hello-world
go get github.com/extism/go-pdk
tinygo build -scheduler=none --no-debug \
-o hello-world.wasm \
-target wasi main.go
# wait for some seconds...
Then start Simplism to serve the new plug-in:
simplism listen \
hello-world.wasm handle --http-port 8080 --log-level info
And in a terminal from the host:
curl http://localhost:9090 \
-H 'content-type: application/json; charset=utf-8' \
-d '{"firstName":"Bob","lastName":"Morane"}'
👋 the host port (
9090
) is mapped on the container port (8080
).
If you want to start some initial tasks once the builder container is started, you can update ./.tasks/init.sh