News for hackers. Stuff that matters.
Re:Build Your Own Docker with Linux Namespaces, Cgroups, and... by shepherdjerred on Tuesday June 27, 2023 @01:47AM (#36489322)
It is a bit nice to have a "full" operating system in your container, especially for debugging.

There doesn't seem to be a _huge_ drawback to running an Ubuntu image vs Alpine, aside from the image size.

Re:Build Your Own Docker with Linux Namespaces, Cgroups, and... by AnonCoward42 on Tuesday June 27, 2023 @02:25AM (#36489522)
Ironically Ubuntu image is worse for debugging than Alpine by default even if it is substantially bigger. `vi` and `less` are missing from Ubuntu for example and are part of Alpine.
Re:Build Your Own Docker with Linux Namespaces, Cgroups, and... by gjvc on Tuesday June 27, 2023 @03:21AM (#36489864)
So? All you have to do is "docker exec -it container /bin/bash" and run "apt update" and "apt install vim", then remake the image with fixes or re-run the container once you've figured it out.
Re:Build Your Own Docker with Linux Namespaces, Cgroups, and... by AnonCoward42 on Tuesday June 27, 2023 @04:52AM (#36490488)
You can always smuggle the debugging tools in even `FROM scratch`, but my point was that "by default" these debugging tools were missing on Ubuntu.
Re:Build Your Own Docker with Linux Namespaces, Cgroups, and... by shepherdjerred on Tuesday June 27, 2023 @11:43AM (#36494487)
The benefit of Ubuntu, at least for me, is that I know it pretty well. Alpine isn't bad, I'm just not familiar with it.
Re:Build Your Own Docker with Linux Namespaces, Cgroups, and... by tracker1 on Tuesday June 27, 2023 @02:07PM (#36496533)
Try debian-slim, should mostly be the same, but save you 100mb+ off of your final size most of the time.
Re:Build Your Own Docker with Linux Namespaces, Cgroups, and... by KronisLV on Tuesday June 27, 2023 @04:08AM (#36490191)
> There doesn't seem to be a _huge_ drawback to running an Ubuntu image vs Alpine, aside from the image size.

I switched from using Alpine for my own images to using Ubuntu instead a while ago: https://blog.kronis.dev/articles/using-ubuntu-as-the-base-fo...

So far, it's surprisingly nice. Ubuntu based images take up more space, but thanks to layer reuse and storage being affordable, this isn't a big issue in practice (at my scale).

There are no surprises in regards to performance or package management that I have to deal with. Actually, I can use Ubuntu/Linux Mint locally and have the same install instructions for tools/dependencies as well (if I want to test things outside of containers, running on the system directly).

It's also really nice to be able to build my own base image with whatever tools I want available (e.g. nano and some debugging stuff) and have them be available in all of the language/stack-specific images that I build later.

The EOL is also pretty long and I don't think that there's any shame in having a "good enough" and somewhat boring distro for most dev stuff, only occasionally looking at PPAs for newer stuff.

That said, Alpine and Debian are both fine as well! I still run Bitnami images for most complex software like databases, which I think used Debian as a base: https://bitnami.com/stacks/containers

Re:Build Your Own Docker with Linux Namespaces, Cgroups, and... by tracker1 on Tuesday June 27, 2023 @02:06PM (#36496521)
Would suggest debian-slim as a base image over Ubuntu. Still deb, and most of the tooling is the same, but smaller base size to start. Also make sure to look into cache and man-file cleanup as part of any apt-get steps.