You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this request, this is straightforward to implement and has clear benefits.
For the CLI syntax, I think it should be provided, optionally, in the argument passed to --dir, perhaps as --dir $src::$dst::ro.
As a quick survey of prior art: Docker has two different syntaxes for read-only volumes https://docs.docker.com/engine/storage/volumes/#use-a-read-only-volume, -v $src:$dst:ro and --mount source=$src,dest=$dst,readonly. From my reading of the podman docs, it supports the -v syntax but not --mount, but I don't have any insight into why podman made that decision.
Wasmtime doesn't match either of Docker's, but given its closer to -v than --mount I think we could add support for a ro or rw specifier after an additional :: separator. There are many alternatives, however - we could treat --dir $src::$dst as legacy syntax (to not break existing users) an start supporting --dir $src:$dst and --dir $src:$dst:ro as the new syntax. We could adopt docker's --mount syntax under wasmtime run -S mount and expose readonly there and not try to add it to --dir. I don't have any particularly strong preferences here but maybe @alexcrichton can chime in, as he did lots of the design of the current CLI scheme.
Feature
When using the
wasmtime run
command I'd like to be able to attach a directory as read-only.Benefit
Currently this works:
But you can break the installation if you run code like this:
I'd like to be able to open a directory as readonly - maybe something like this:
Implementation
The underlying library has support for this:
https://docs.rs/wasmtime-wasi/latest/wasmtime_wasi/struct.WasiCtxBuilder.html#method.preopened_dir
Exposing that in the CLI would be very useful.
The text was updated successfully, but these errors were encountered: