4 ms·
Nah. Docker was created to solve the "works on my machine" problem. Because Linux made the wrong choice of having a global pool of shared libraries. So Docker h
by forrestthewoods 1y ago
Nah. Docker was created to solve the "works on my machine" problem. Because Linux made the wrong choice of having a global pool of shared libraries. So Docker hacked around this by containerizing a full copy of the desired environment.
What Docker has done is kinda right. Programs should include all of their dependencies! But it sucks that you have to fight really hard and go out of your way to work around Linux's original choices.
Now you may be thinking wait a second Linux was right! It's better to have a single copy of shared libraries so they can be securely updated just once instead of forcing every program to release a new update! Theoretically sure. But since everyone uses Docker you have to (slowly and painfully) rebuild the image and so that supposed benefit is moot. Womp womp.
Additional reading if you are so inclined: https://jangafx.com/insights/linux-binary-compatibility https://jangafx.com/insights/linux-binary-compatibility
- edoceo 1y agoI'm firmly in the SO camp. One thing I see is that folk who are making software for Linux target Distribution rather than Linux generic. It's because of the SO "problem". It's a benefit of the tight coupling of Windows or Mac (which I don't use). Full agree that security updates in the Docker world is like the problem from static builds. Disclosure: I ship some stuff on Linux; for the problems we do static & docker. The demand side also seems to favour docker. I also prefer the docker method; for the compatibility reasons.
- forrestthewoods 1y agoStrong agree on the “target distro” or even “target specific env” versus Linux. I think I disagree on Windows being tightly coupled. Windows simply has a barren global library path. Programs merely included their extra DLLs adjacent to the exe. Very simple and reliable. Linux has added complexity in that glibc sucks and is horribly architected. GCC/Clang are bad and depend on the local environment waaaay too much. Linux ecosystem is very much not built to support sharing cross compiled binaries. It’s so painful. :(
- seec 1y agoI think the idea of shared libraries is also linked to a problem of the past: expensive storage (especially fast storage). Nowadays SSDs with decent random IO are quite cheap to the point where even low-end hosting has them, and getting spinning disks is a choice reserved for large media files. On the consumer side, we are below a hundred dollars for one TB, so the storage savings are not very relevant. But if you go back to when Linux was designed, storage was painfully expensive, and potentially saving even a few hundred megabytes was pretty good. But I do agree that shared libraries are generally a bad idea and something that will most likely create problems at some point. Self-contained software makes a lot more sense generally speaking. And I definitely think that Docker is a dumb "solution" for software distribution but the problem really starts with devs using way too many dependencies.
- array_key_first 1y agoLinux didn't make that choice, some Linux distros did. And it's a trade off - the alternative uses dramatically more disk space. Plus, with a package manager, sharing libraries becomes much, much easier. If you really, truly, hate that then just statically link stuff. That's always been allowed. Statically linked Linux binaries will run for decades. The idea that Linux binaries rot while windows has some magic that makes them live is just made up. "But what about glibc???" Yeah that's made up. Glibc doesn't break ABI like people think they do. If you look, the glibc ABI is incredibly stable across decades. SOME highly specific gnu-only extensions have been broken. You're not using those, it's a made up problem.