3 ms·
Is this a "why not" project, or are there real-world use cases for this?
by momojo 3y ago
Is this a "why not" project, or are there real-world use cases for this?
- simonw 3y agoBeing able to run ANY Docker container directly in the browser is incredibly useful. The most obvious application is educational environments - this makes it trivial to provide all sorts of software for students to tinker with without needing to run any server-side code anywhere, just some static file hosting.
- Havoc 3y agoI very much doubt it's "any" docker image. WASM isn't 1:1 feature equivalent with docker. e.g. filesystem access
- simonw 3y agoIt looks to me like they solve that by simulating the entire Linux operating system, filesystem included. You won't get persistence when you restart the process, but you'll still be able to run code that needs to read and write files. Try it for yourself: visit https://ktock.github.io/container2wasm-demo/amd64-debian-wasi.html https://ktock.github.io/container2wasm-demo/amd64-debian-was... to start a shell against a Debian container, then use "echo 'hi' > hello.txt" to write a file and "cat hello.txt" to read it.
- chmod775 3y ago> You won't get persistence when you restart the process, but you'll still be able to run code that needs to read and write files. Since it's Linux and you can give it "network access" (using workarounds such as redirecting via a server), you can just use one of the existing ways to mount a remote filesystem that could be stored on the server (such as NFS, sshfs, ...). Or bridge/mount to the local browser and store it in indexeddb or whatever. It already has directory mapping when running outside a browser - maybe there's even an easy way to do this more directly than funneling everything through the virtual network.
- benno128 3y agoThis is the use case I've been tackling with Runno (https://runno.dev https://runno.dev), it's more performant than OP's approach but not as flexible.
- pseudosavant 3y agoBeing able to do it client-side eliminates the biggest cost barrier (VM time) and risks (people using your VMs for cryptomining) that you encounter trying to offer real 'labs' for users.
- jedisct1 3y agoThere are tons of real-world use cases. WASM is more or more being used to extend applications with custom functions/plugins, as well as function-as-a-service services. But they usually require writing custom code, specifically for these environments. The ability to build standard containers, use any languages and tools, run shell scripts, etc. makes WebAssembly far more accessible. Complex applications can be tested natively, and deployed effortlessly later to environments that require WebAssembly. From a performance perspective, this is not optimal. But from a productivity perspective, this is awesome, and definitely something to have in your toolbox when all you need is get things done.