Remix.run Logo
dev_l1x_be 5 hours ago

All docker containers should have been like that. apt-get update in a docker build step is an anti pattern.

bluGill 2 hours ago | parent | next [-]

You are screwed either way. If you don't update your container has a ton of known security issues, if you do the container is not reproducable. reproducable is neat with some useful security benefits, but it is something a non goal if the container is more than a month old - day might even be a better max age.

tosti 22 minutes ago | parent | next [-]

Why is there a need for a package manager inside a container at all? Aren't they supposed to be minimal?

Build your container/vm image elsewhere and deploy updates as entirely new images or snapshots or whatever you want.

Personally I prefer buildroot and consider VM as another target for embedded o/s images.

dev_l1x_be 2 hours ago | parent | prev [-]

I update my docker containers regularly but doing it in a reproducible, auditable, predictable way

tom1337 an hour ago | parent [-]

Could you explain how you achieve this?

oefrha an hour ago | parent [-]

Chainguard, Docker Inc’s DHI etc. There’s a whole industry for this.

rascul 37 minutes ago | parent | prev | next [-]

I disagree with that as a hard rule and with the opinion that it's an anti-pattern. Reproducible containers are fine, but not always necessary. There's enough times when I do want to run apt-get in a container and don't care about reproducibility.

DuncanCoffee 5 hours ago | parent | prev | next [-]

I know it's an anti-pattern, but what is the alternative if you need to install some software? Pulling its tagged source code, gcc and compile everything?

kandros 3 hours ago | parent | next [-]

Copying from another image is an under appreciated feature

FROM ubuntu:24.04

COPY --from=ghcr.io/owner/image:latest /usr/local/bin/somebinary /usr/local/bin/somebinary

CMD ["somebinary"]

Not as simple when you need shared dependencies

Filligree 2 hours ago | parent | prev | next [-]

Run “nix flake update”. Commit the lockfile. Build a docker image from that; the software you need is almost certainly there, and there’s a handy docker helper.

klodolph an hour ago | parent | next [-]

Recently I’ve been noticing that Nix software has been falling behind. So “the software you need is almost certainly there” is less true these days. Recently = April 2026.

sestep 39 minutes ago | parent [-]

Are you referring to how the nixpkgs-unstable branch hasn't been updated in the past five days? Or do you have some specific software in mind? (not arguing, just curious)

PunchyHamster an hour ago | parent | prev [-]

oh, great, adding more dependency, and one that just had serious security problem

hexa555 an hour ago | parent [-]

as if other sandboxing software is perfect

tosti 19 minutes ago | parent [-]

Nothing is perfect. (FreeBSD jails come close but still no.)

bennofs 3 hours ago | parent | prev | next [-]

Both Debian and Ubuntu provide snapshot mirrors where you can specify a date to get the package lists as they looked at that time.

bluGill 2 hours ago | parent [-]

Which is only useful for historical invesigation - the old snapshot has security holes attackers know how to exploit.

lloeki an hour ago | parent [-]

> the old snapshot has security holes attackers know how to exploit.

So is running `docker build` and the `RUN apt update` line doing a cache hit, except the latter is silent.

The problem solved by pinning to the snapshot is not to magically be secure, it's knowing what a given image is made of so you can trivially assert which ones are safe and which ones aren't.

In both cases you have to rebuild an image anyway so updating the snapshot is just a step that makes it explicit in code instead of implicit.

liveoneggs 2 hours ago | parent | prev | next [-]

pretend you don't do it and add your extra software to the layer above

rowanG077 5 hours ago | parent | prev | next [-]

With a binary cache that is not so bad, see for example what nix does.

Pay08 5 hours ago | parent [-]

I don't really see how that's different from a normal binary install of a reproducible package. Especially with the lacking quality of a lot of Nix packages.

bandrami 2 hours ago | parent | next [-]

If you're in a situation where you want reproducibility you're using nix to build your own packages anyways, not relying on their packages

rowanG077 4 hours ago | parent | prev [-]

It's not if you can pin the package. It gives you reproducable docker containers without having to rebuild the world. Wasn't that the entire question?

dev_l1x_be 2 hours ago | parent | prev [-]

base image

software component image

both should be version pinned for auditing

bandrami 2 hours ago | parent | prev | next [-]

This has been a solved problem for over two decades now with Nix but people can't be asked

dev_l1x_be 2 hours ago | parent [-]

It has been solved even without Nix for a long time, just laziness is probably why we are not doing it

malikolivier 4 hours ago | parent | prev [-]

This is to solve such issues that I am using and running StableBuild.

It is a managed service that keeps a cached copy of your dependencies at a specific time. You can pin your dependencies within a Dockerfile and have reproducible docker images.

schonfinkel 4 hours ago | parent [-]

I don't wanna be that guy but...

NIX FIXES THIS.

dijit 3 hours ago | parent [-]

So does Bazel. :p

evanjrowley 22 minutes ago | parent [-]

adding to the list, one exotic approach to this problem is stagex https://codeberg.org/stagex/stagex