Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.


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.


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.


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.


Try debian-slim, should mostly be the same, but save you 100mb+ off of your final size most of the time.


> 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


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: