News for hackers. Stuff that matters.
Re:Rails on Docker · Fly by e12e on Thursday January 26, 2023 @11:59AM (#34534461)
Note that the explicit "apt-get clean" is probably redundant:

https://docs.docker.com/develop/develop-images/dockerfile_be...

> Official Debian and Ubuntu images automatically run apt-get clean, so explicit invocation is not required.

Re:Rails on Docker · Fly by yrro on Thursday January 26, 2023 @03:58PM (#34538741)
'apt-get clean' doesn't clear out /var/lib/apt/lists. It removes cached downloaded debs from /var/cacpt/apt but you'll still have hundreds of MiB of package lists on your system after running it.
Re:Rails on Docker · Fly by e12e on Thursday January 26, 2023 @06:02PM (#34540122)
Yes, but apt-get clean is still redundant [ed: because the upstream Debian/Ubuntu images automatically runs apt-clean via how dpkg/apt is configured - and your image should inherit this behavior]. Personally I'm not a fan of deleting random files like man pages and documentation - so instead of:

  RUN apt-get update -qq && \
    apt-get install -y build-essential libvips && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man
I'd do:

  RUN apt-get update -qq && \
    apt-get install -y build-essential libvips && \
    rm -rf /var/lib/apt/lists/*
Re:Rails on Docker · Fly by cvccvroomvroom on Thursday January 26, 2023 @11:18PM (#34542418)
Not a fan of violently modifying the system outside of the package manager either.

rm -rf isn't configuration management, it's system entropy increasing leaving users scrambling to reinstall the world.

If people don't want docs, then distro vendors should package them separately and make them recommended packages.

Re:Rails on Docker · Fly by e12e on Friday January 27, 2023 @08:38AM (#34545814)
Indeed. If you want a small image, there's "slim" and "alpine" variants.
Re:Rails on Docker · Fly by cvccvroomvroom on Thursday January 26, 2023 @11:14PM (#34542391)
As I mentioned above, I recommend avoiding Ubuntu because it violates the principle of dev - prod parity. For any significant scale, Ubuntu will be left in the dust. Don't rely on system packages, build your own stream of minimal vendored (/opt/company) dependencies and keep them current because defaults are always old and don't consistently apply necessary patches for bugfixes and functionality.

https://quay.io/repository/centos/centos

Re:Rails on Docker · Fly by POPOSYS on Friday January 27, 2023 @03:25AM (#34543886)
Please explain

"I recommend avoiding Ubuntu because it violates the principle of dev - prod parity."

What exactly is the problem? Would you please like to provide sources to this issue / some explanation / any helpful content? THANKS!

Re:Rails on Docker · Fly by cvccvroomvroom on Thursday January 26, 2023 @11:06PM (#34542329)
Yeap. Various docker images are built with pkg mgmt file install exclusions and rm -rf.

It's good to have a slim script but also to have an unslim when you need manpages or locales.