2 ms·
Even the Docker support team is confused by this. Most of why I stopped engaging is that they would reject a feature because it lead to dockerfiles they said we
by hinkley 3y ago
Even the Docker support team is confused by this. Most of why I stopped engaging is that they would reject a feature because it lead to dockerfiles they said were 'not reproducible', but were just as reproducible as many of the core features.
Which is to say, not in the slightest.
Every time you do something in a Dockerfile that involves pulling something from the network, you don't have reproducibility. Unless you pull something using a cryptographic hash (which I've never actually seen anyone do), the network can give you a different answer every time. The answer might not even be idempotent (calling it once changes the result of calling it again).
My argument was the same as yours. Virtually every dockerfile has an 'update' call as the second or third layer, which means none of the repeatable layers afterward (like useradd or mkdir) are actually repeatable. You're building a castle on the sand.
Docker images are reproducible. Docker builds are not. And that's okay, as long as everyone accepts that to be true. And if Docker contributors can't accept that then we are all truly fucked, until something else comes along that retreads the ideas.
- xvector 3y agoSounds like Nix is what you're looking for.
- evilduck 3y agoWhich can conveniently produce Docker images.
- Quekid5 3y agoIs there some documentation on exactly how to do this? I've been curious about this in the past, but my search-fu is failing me...
- arianvanp 3y agoThere's a whole chapter on images (VM, docker, appimage) in the manual. I can recommend starting there. https://nixos.org/manual/nixpkgs/stable/#chap-images https://nixos.org/manual/nixpkgs/stable/#chap-images The smallest example is: pkgs.dockerTools.buildLayeredImage { name = "hello"; contents = [ pkgs.hello ]; }
- MichaelZuo 3y agoIs there really a significant number of folks who are confused by the idea that networks can serve different files under the same name at different times?