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

Support wasm module in actual docker image #1003

Closed
sshaplygin opened this issue Nov 12, 2023 · 2 comments
Closed

Support wasm module in actual docker image #1003

sshaplygin opened this issue Nov 12, 2023 · 2 comments

Comments

@sshaplygin
Copy link

sshaplygin commented Nov 12, 2023

Hey, everyone!

I pulled default unit image from docker hub and tried usage wasm module with exec command:

docker exec -ti web curl -X PUT -d '{"helloworld": {"type":"wasm","module":"/www/helloworld/main.wasm"}}' --unix-socket  \
       /var/run/control.unit.sock http://localhost/config/applications

I had next error:

{
        "error": "Invalid configuration.",
        "detail": "The module to run \"wasm\" is not found among the available application modules."
}

Default image doesn't have wasm module?

my env:

os: macos
arch: arm64
docker version: Docker version 24.0.6, build ed223bc
image: 
IMAGE          CREATED       CREATED BY                                      SIZE      COMMENT
648c40d7602f   10 days ago   /bin/sh -c #(nop)  CMD ["unitd" "--no-daemon…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  EXPOSE 80                    0B        
<missing>      10 days ago   /bin/sh -c #(nop)  ENTRYPOINT ["/usr/local/b…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  STOPSIGNAL SIGTERM           0B        
<missing>      10 days ago   /bin/sh -c #(nop) COPY multi:44b909b4ee0b15a…   3.62kB    
<missing>      10 days ago   /bin/sh -c #(nop) COPY file:8b65557c2137d1a3…   3.96kB    
<missing>      10 days ago   /bin/sh -c set -ex     && savedAptMark="$(ap…   24.2MB    
<missing>      10 days ago   /bin/sh -c #(nop)  LABEL org.opencontainers.…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  LABEL org.opencontainers.…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  LABEL org.opencontainers.…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  LABEL org.opencontainers.…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  LABEL org.opencontainers.…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  LABEL org.opencontainers.…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  LABEL org.opencontainers.…   0B        
<missing>      10 days ago   /bin/sh -c #(nop)  CMD ["bash"]                 0B        
<missing>      10 days ago   /bin/sh -c #(nop) ADD file:99dc83e8bb8c67d91…   74.4MB       
@tippexs
Copy link
Contributor

tippexs commented Nov 13, 2023

Thanks for reaching out!

Currenlty we are working on two different wasm-modules. The one that makes use of our own SDK can be pulled by issuning

docker pull unit:wasm see https://hub.docker.com/_/unit

The other module is based on Rust and supports the Wasm Component Model and can be used with wasm-wasi-http.
This can be pulled issuing docker pull nginx/unit-preview:wasm-wasi-http

To learn more about how to use is see this README

@sshaplygin
Copy link
Author

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants