I absolutely love how we are going full circle to portable executable binaries but with embedded OS. Taking the whole "it works on my machine" to a whole new level of troubleshooting hell. Awesome project though.
Every decent application should be a portable executable binary!
Show HN: dockerc – Docker image to static executable "compiler"
111–120 of 150 posts
Re: Show HN: dockerc – Docker image to static executable "compiler"
#112This can be useful for certain people, but I am surprised the documentation (there is just the Readme) doesn't mention what happens when you already have a docker daemon- esp. what happens to all the networking/firewall tricks docker is using. I see potential for quite a number of operational issues. Nice to see Zig in action, btw. What about using Zon for deps, instead of a git submodule? Just curious if the author…
> What about using Zon for deps, instead of a git submodule?
I couldn't find documentation quickly enough (dockerc was initially during a hackathon and was my first time using Zig). I plan to fix this eventually.
Re: Show HN: dockerc – Docker image to static executable "compiler"
#113Re: Show HN: dockerc – Docker image to static executable "compiler"
#114Nice, but what's the difference between this and AppImage?
dockerc allows you to re-use your existing docker images without having to spend time packaging something up.
The applications running from dockerc-generated executables run inside a container so they are guaranteed to be hermetic.
Re: Show HN: dockerc – Docker image to static executable "compiler"
#115Can it be done for docker compose (in theory) too?
Re: Show HN: dockerc – Docker image to static executable "compiler"
#116It's interesting. According to the source code, it uses FUSE to mount the container's internal filesystem. This means that the compiled binary will either need root privileges to run, or the user must have configured FUSE to allow non-root mounting. Not ideal, but there's not much of an alternative either.
An alternative is to extract the image to disk but that has quite a bit of overhead.
Re: Show HN: dockerc – Docker image to static executable "compiler"
#117So what does this mean? That I can finally ship portable Ruby executable without requiring the end user to install Ruby?
You should also be able to do that with Cosmopolitan/APE.
Could also be a skill issue.
Re: Show HN: dockerc – Docker image to static executable "compiler"
#118What about Cosmopolitan and WASM? ;) Cosmopolitan libc allows compiling of a single binary that runs on multiple OS platforms without modification – maybe Dockerc could use this to create a more universally portable container binary? WASM binaries could run in the browser, or another WASM VM, including securely sandboxed environments that spin up fast. I understand that newer Docker builds can use WASM under the hood…
As for WASM, this is already possible using container2wasm[0] and wasmer[1]'s ability to generate static binaries.
[0]: https://github.com/ktock/container2wasm
[1]: https://wasmer.io/
Re: Show HN: dockerc – Docker image to static executable "compiler"
#119dockerc works by using: Zig + crun + squashfs/overlayfs. Nils (the author) posted a bit more in this thread for anyone interested: https://news.ycombinator.com/item?id=39621573
Re: Show HN: dockerc – Docker image to static executable "compiler"
#120What about Cosmopolitan and WASM? ;) Cosmopolitan libc allows compiling of a single binary that runs on multiple OS platforms without modification – maybe Dockerc could use this to create a more universally portable container binary? WASM binaries could run in the browser, or another WASM VM, including securely sandboxed environments that spin up fast. I understand that newer Docker builds can use WASM under the hood…
Unfortunately cosmopolitan wouldn't work for dockerc. Cosmopolitan works as long as you only use it but container runtimes require additional features. Also containers contain arbitrary executables so not sure how that would work either... As for WASM, this is already possible using container2wasm[0] and wasmer[1]'s ability to generate static binaries. [0]: https://github.com/ktock/container2wasm [1]: https://wasmer.…