4 ms·
>"Daniel Firth: So the main difference with Docker is that Docker is imperative. It’s not declarative. Obviously isn’t. It’s not a language really. All it says
by peter_d_sherman 4y ago
>"Daniel Firth: So the main difference with Docker is that Docker is imperative. It’s not declarative. Obviously isn’t. It’s not a language really. All it says is execute the steps in order. And
Docker will arbitrarily trust the internet.
So if you make an Ubuntu image in Docker, and then you say, execute these apt install steps, it will go and contact the Ubuntu Package Manager. And it will trust the internet at that point.
So there’s no guarantee that if you try and build a Docker container using Docker today, that it will be the same Docker image that you build in a year.
Whereas with Nix, the inputs completely determine the outputs, and all of the inputs are cryptographically hashed. And all of the outputs are cryptographically hashed. So it knows if there’s a mismatch if someone has changed the source on the internet, for example, [or] a source has gone missing. There’s no way it’s going to accidentally introduce a source that you didn’t intend to go into the image, whereas Docker will just pull whatever is there."
I think this quote by Daniel Firth highlights the difference between NixOS and Docker exceedingly well...