Live data from Hacker News

Show HN: dockerc – Docker image to static executable "compiler"

github.com

61–70 of 150 posts

Re: Show HN: dockerc – Docker image to static executable "compiler"

#61

The README indicates that this tool will only support Windows and MacOS through emulation. I find that odd. Let's face it, if you're using Linux, you're comfortable typing some stuff into the terminal to install software. Or if you aren't comfortable with it yet, you will be soon. That's just the reality of using Linux. Even ignoring that, snap and flatpak apps provide a generally awful user experience, and I fail to…

The way container runtimes on Linux work is fundamentally different to MacOS and Windows. You need virtualization (albeit, lighter weight since they can use the host kernel) to run containers on Windows and MacOS.

QEMU is kind of overkill because MacOS provides the VzVirtualMachine API through the Virtualization Framework, which can initialize a VM with the host's kernel. On Windows you can use Hyper-V, which is iirc how docker on Windows gets this done.

If MacOS and Windows had pid/mount/network namespaces, overlayfs, and allowed for unrestricted chroot (MacOS requires disabling SIP for that) then you could do the same thing on all platforms. Today, you need virtualization.

Re: Show HN: dockerc – Docker image to static executable "compiler"

#62
post #46

I think this is a cute side project but as an actual piece of a company’s stack this just screams antipattern

Yeah, I don't think this makes that much sense for internal distribution. Especially if you use kubernetes.

The use case is for distributing software to end users.

Re: Show HN: dockerc – Docker image to static executable "compiler"

#63
post #51

Awesome use of that rant pic. Next rant pic- When I RUN a F*ING EXE it should open a Window with the application in it you smelly nerds!!!!

I know it feels like being pedantic and missing the joke, but "just give me the EXE" is a terrible bug, not a feature request. Distributing unauthenticated, untraced OS-level binaries is just dangerous in the modern world. Safe app distribution requires either elaborate sandboxed runtimes (browsers) or carefully curated and maintained lists of known-safe binaries (app stores, distro package repositories). We can't be…

If you're considering "just give me the exe" as multiple sharing between people, I wholeheartedly agree that it's a mistake, but the context here is of a person wanting to download the binary from the author themselves.

Re: Show HN: dockerc – Docker image to static executable "compiler"

#64
post #37

Enroot can do something similar: https://github.com/NVIDIA/enroot/blob/v3.4.1/doc/cmd/bundle....

That's really cool. I didn't know about that. Thanks for sharing.

There's a few things that seem to make it unsuitable for the intended use case of dockerc:

* The container extracts itself which means there is quite a bit of overhead for large images. dockerc-built executables have the same startup time whether the image is 2.2GB or 25MB.

* The executables produced by enroot don't seem suitable for running standalone. At least the example doesn't seem to suggest so.

Re: Show HN: dockerc – Docker image to static executable "compiler"

#66
post #31
post #26

Earlier quoted context omitted.

> How static are we talking here? Enough for the executables to run everywhere. So I'm happy for system libraries to be dynamically linked. > But do you even want to distribute Windows binaries? That's what I'm imagining. A windows binary that starts a Linux VM in which the container runs. > Does this include automagically mounting filesystems? Yep, inside of the Linux kernel. Here's what PID 1 looks like: https://gi…

Hey, I appreciate the reply! > A windows binary that starts a Linux VM in which the container runs. I'm afraid my wording was somewhat ambiguous here. I meant to ask "do you aim to wrap Windows apps in a single Windows binary", but I suppose you answered my question anyway. You want to distribute Linux applications to Windows users. Running on Windows/macOS was also the context in which I meant to ask about filesyste…

> Running on Windows/macOS was also the context in which I meant to ask about filesystem mounts.

That's not an issue because the mounts are within the Linux VM. At least as long as you're not trying to implement volumes.

> I understand this is not something that's implemented yet, but I'm wondering about your goals.

Make a better alternative for all the projects that suggest using `docker run` in their READMEs. Something that's easy to setup (re-use existing Dockerfiles) and something that doesn't depend on pre-existing setup from the user (which docker does).

> The much larger hurdle I see for Windows support is that I don't think you can setup virtualization without Admin privileges in the general case. If Hyper-V is not already present and enabled you'll need to install some hypervisor. Even QEMU needs Hyper-V for proper virtualization.

That's good to know. I didn't know that. I guess it will need to use emulation in some cases then.

Re: Show HN: dockerc – Docker image to static executable "compiler"

#67

Awesome use of that rant pic. Next rant pic- When I RUN a F*ING EXE it should open a Window with the application in it you smelly nerds!!!!

Im surprised no one mentioned that the program the unstable ranter wants is essentually a social media stalker app to find people on all social media sites.

Perhaps some barriers to use are good sometimes.

Re: Show HN: dockerc – Docker image to static executable "compiler"

#68
post #11

Same thing as Apptainer/Singularity? Or a different approach? I always remember having issues using the Singularity outputs for anything that needed to interact with the filesystem.

I hadn't heard of Apptainer/Singularity before but it doesn't seem to provide the ability to create standalone executables.

Re: Show HN: dockerc – Docker image to static executable "compiler"

#69

Can I run this in a container?

dockerc can, the produced executables cannot, at least not without some tweaking.

Even if you path through `/dev/fuse` and `/usr/bin/fusermount3` (using -v) it fails the mount the fuse filesystems with the error message "Operation not permitted".

It might be possible to make it work if it falls back to extracting the container when failing the mount the fuse filesystems.

Re: Show HN: dockerc – Docker image to static executable "compiler"

#70

Awesome use of that rant pic. Next rant pic- When I RUN a F*ING EXE it should open a Window with the application in it you smelly nerds!!!!

Im surprised no one mentioned that the program the unstable ranter wants is essentually a social media stalker app to find people on all social media sites. Perhaps some barriers to use are good sometimes.

If they don't want people to find their social media profiles, then they shouldn't have social media profiles.
Post reply on HN