News for hackers. Stuff that matters.
Re:Why does Zig make Docker irrelevant by AndyKelley on Wednesday October 19, 2022 @08:59PM (#33269689)
I wrote that text. People were unnecessarily trying to use Docker in order to build their Zig applications and so this is a dramatic way to point out that you don't need to do that because you can make them statically compiled and thus run in any Linux environment. That GitHub repository is only for creating Drone CI images.

If you were going to put a Zig application into a Dockerfile you could use `FROM scratch`.

Of course you may have other uses for Docker, that's fine. This text is for people coming from e.g. Go or Python where the reflex is to unconditionally use Docker. When using Zig this should be questioned.

Re:Why does Zig make Docker irrelevant by mfext on Thursday October 20, 2022 @12:28AM (#33270817)
Interesting, I understand now thanks to your reply and a couple others. I’ve been living in an interpreted echo system for too long (nodejs, python) I suppose, so I was looking through a runtime-focused lense where Docker shines so the word choice seemed radical. This is a cool project, thank you for taking the time to respond!
Re:Why does Zig make Docker irrelevant by aprdm on Thursday October 20, 2022 @01:55AM (#33271316)
Isn't go statically compiled by default also..?
Re:Why does Zig make Docker irrelevant by _gerald_ on Thursday October 20, 2022 @07:55AM (#33273303)
It is. The guy is pushing a narrative. It's still a good idea to Dockerize your apps even if they are statically compiled. If your app has C dependencies e.g. libxml2, it won't run on another system if the required C headers are missing.

Another good reason for using Docker with Zig is shareability since Zig doesn't have a package manager.

Re:Why does Zig make Docker irrelevant by kristoff_it on Thursday October 20, 2022 @11:47AM (#33276474)
Go is only statically linked when not depending on C code, if you're using CGo, you cannot get a statically linked executable with Go alone, and a lot of Go projects do depend on C code. You also lose Go's cross-compilation when using CGo.

In fact, Zig is used in combination with CGo to create statically linked executables and re-enable cross-compilation: https://dev.to/kristoff/zig-makes-go-cross-compilation-just-...

Same also applies to Rust: https://actually.fyi/posts/zig-makes-rust-cross-compilation-...

> It's still a good idea to Dockerize your apps even if they are statically compiled. If your app has C dependencies e.g. libxml2, it won't run on another system if the required C headers are missing.

You clearly don't understand the meaning of statically linked nor how dynamic linking works. Spend less time concern-trolling and more learning software engineering, friend ;^)