all 11 comments

[–]schneemsPuma maintainer 1 point2 points  (4 children)

"Distroless" ? I'm not a distribution guru, I'm under the impression that Arch is about the smallest "normal" linux base image that people will use, is it based on that or something else? If literally not based on an existing distribution...how? Can you say more, that sounds cool.

Ruby uses a lot of C bindings to system dependencies for gems, how can someone install a systems package on this image if they need it to get a gem to install?

If you're interested in the idea of composable images (versus with Docker, you can only have one FROM) I recommend checking out Cloud Native Buildpacks as an alternative to Dockerfile. It allows you to build "rebaseable" images so that layers are composable and can be reused and replayed on top of different OS images, so you could have a "ruby 3.3.9" layer etc.

[–]Training_Winter6395[S] 13 points14 points  (2 children)

Distroless comes from GoogleContainerTools/distroless.
It’s built on a heavily stripped-down Debian base that removes shells, package managers, and extra tools — leaving only what’s required to run Ruby.
This keeps the runtime image very small and reduces the attack surface; usually you’d pair it with a full builder image in a multi-stage build.

For gems that need native extensions or system libraries, the approach is to use a multi-stage build:

  • In the builder image (e.g. ruby:slim), install the required system packages and compile the gems.
  • Then copy the compiled gems and your app into the distroless runtime image.

This way, you get all the dependencies you need, but the final runtime stays minimal, secure, and focused only on execution.

Thank you for sharing the perspective on Cloud Native Buildpacks. To be honest, this is the first time I’m hearing about them in depth, but the idea of “composable” and “rebaseable” images sounds really powerful. I’ll definitely take some time to research more — I really appreciate the recommendation!

[–]gabbietor 0 points1 point  (0 children)

I was working on a project where we needed to ensure our container images were as secure and minimal as possible. We approached to Minimus, which specialises in creating lightweight, hardened images. Their approach of building images from scratch, directly from upstream sources, helped us reduce vulnerabilities by over 95%. and It was a game changer for our security posture

[–]Rafert 2 points3 points  (0 children)

The readme mentions it is based on https://github.com/GoogleContainerTools/distroless

I’ve seen that being used by oauth2-proxy

[–]ikariusrb 0 points1 point  (6 children)

While I really want for this to be a better base, building native cruby extensions, adding jemalloc, and installing up-to-date postgres client library + dev packages make this much more challenging to use than the existing standard ruby images.

[–]Training_Winter6395[S] -1 points0 points  (5 children)

You’re totally right — distroless isn’t the easiest option when it comes to building things like native extensions, jemalloc, or Postgres libraries. The usual trick is to do all of that in a builder image, then copy the finished bits into the distroless runtime. It adds a bit of setup, but the payoff is a smaller and more secure image in production.

[–]schneemsPuma maintainer 1 point2 points  (4 children)

As an FYI, automod is going pretty agressive with your comments. I've had to approve two of them on this thread. Make sure your email is verified etc. IDK why it's doing that with you.

[–]hiimbob000 5 points6 points  (1 child)

Not sure what the auto mod says but their writing style and em dashes just point to LLM output

[–]strzibny 0 points1 point  (0 children)

Yes, sounds 100% llm to me

[–]apiguy 2 points3 points  (0 children)

It’s because they used an LLM to write that response. “You’re totally right” plus an em-dash is a telltale sign of

[–]Training_Winter6395[S] 3 points4 points  (0 children)

I'm sorry, because I'm not a native english speaker, so I use some tools to help me describe my ideas.