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

how to define/run wasmtime serve command in OCI image. #16

Open
BhavinPrajapti opened this issue Jun 21, 2024 · 1 comment
Open

how to define/run wasmtime serve command in OCI image. #16

BhavinPrajapti opened this issue Jun 21, 2024 · 1 comment

Comments

@BhavinPrajapti
Copy link

I have followed your steps and it it working fine locally. i can run hello_wasi_http.wasm on my local machine with below command.
wasmtime serve /hello_wasi_http.wasm

I have configured minikube cluster with wasmtime runtime. for normal helloworld below OCI image is working fine.

FROM scratch
ADD hello-wasm.wasm /
CMD ["/hello-wasm.wasm"]

but now i want to build image with http serve. then how can I define docker file with serve?

FROM scratch

Add the Wasm file to the container

ADD hello_wasi_http.wasm /hello_wasi_http.wasm

Expose port 8080

EXPOSE 8080

Start the Wasmtime server

CMD ["wasmtime", "serve", "/hello_wasi_http.wasm"]

i tried this one but not working. can you please tell how can I access http server ?

@sunfishcode
Copy link
Owner

I'm not sure what the problem is here. Are you able to see the standard error output of wasmtime? It should print a message like "Serving HTTP on http://0.0.0.0:8080/" or so; do you see that?

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

No branches or pull requests

2 participants