We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go code:
package main import ( "net/http" "github.com/stealthrocket/net/wasip1" ) func main() { listener, err := wasip1.Listen("tcp", "127.0.0.1:3000") if err != nil { panic(err) } server := &http.Server{ Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello, World!")) w.WriteHeader(http.StatusOK) }), } if err := server.Serve(listener); err != nil { panic(err) } }
dockerfile:
FROM scratch COPY bin/test.wasm ./test.wasm CMD ["/test.wasm"]
build:
GOOS=wasip1 GOARCH=wasm go build -o bin/test.wasm cmd/test/main.go docker build -t meyoulvcha/wasm-test:v1.0 -f ./build/test/Dockerfile --platform=wasi/wasm . docker push meyoulvcha/wasm-test:v1.0
docker run:
docker pull meyoulvcha/wasm-test:v1.0 docker run --rm --network host --name=wasm-test --runtime=io.containerd.wasmedge.v1 --platform=wasi/wasm meyoulvcha/wasm-test:v1.0
It is not listening 3000 port:
I dont know whats wrong. Can someone help me?
The text was updated successfully, but these errors were encountered:
expose 3000 should do the trick in your Docker setup
Sorry, something went wrong.
No branches or pull requests
go code:
dockerfile:
build:
docker run:
It is not listening 3000 port:
I dont know whats wrong. Can someone help me?
The text was updated successfully, but these errors were encountered: