hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.7K
active users

Recently there's a lot of posts about writing minimal Docker images from Nix flakes, such as:

tmp.bearblog.dev/minimal-conta (by Herman, from BearBlog)

and

xeiaso.net/talks/2024/nix-dock (by pony.social/@cadey)

These last two weeks I've been learning Nix from zero. Yesterday, I was able to finish a flake that outputs a 4.2MB (gzipped) Docker image for one of my projects, a static SPA which I bundled with Static-Web-Server.

It's awesome that we have the means to achieve this.

Mellow RootMinimal containers using NixThis was written years ago but never published. Recently I learned that you can create your own distroless docker images with Nix! "Distroless" images conta...

To achieve this, I had to walk a error prone, confusing and painfully slow progressing path, where jumping between docs, blog posts, discourse topics and PR/Issues felt like looking for fabrics to stitch together just to get things working.

There's a lot of great Nix resources out there, but there's also a reason why devs prefer using tools like flox, devenv, devbox, etc. from straight up using the underlying technology.

It's amazingly complex to get things up and running. It also happens that, while most resources provide practical examples for readers to learn from, those still end up being snippets and simpler examples covering first principles and fundamentals of Nix.

I've been thinking about releasing a small series of blog posts focused in a personal, pragmatic approach on how to get things done with Nix and flakes from my personal experience.

If anyone interested in such series, please let me know!

oxcabe::from::<Region>("🇮🇨")

At some point in this adventure, I got the image size reduced to a fifth, just by changing two lines inside the flake.nix file. It felt unbelievable.

The gzipped image. I plan to keep reducing its size, since some static media could be optimized and binaries are not stripped.

Static-Web-Server also supports serving brotli compressed content, which could help shrinking the image even more.