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.

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

NIX FIXES THIS.

So does Bazel. :p

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