News for hackers. Stuff that matters.
Re:LXC vs. Docker by tra3 on Friday February 18, 2022 @02:04PM (#30389767)
Can you expand on how builds aren't reproducible?

I though Dockerfile ensured that builds are indeed reproducible?

Re:LXC vs. Docker by Ajedi32 on Friday February 18, 2022 @02:18PM (#30389938)
Running the same script every time doesn't necessarily guarantee the same result.

Lots of docker build scripts have the equivalent of

  date > file.txt
or

  curl https://www.random.org/integers/?num=1&min=1&max=1000&col=1&base=10&format=plain&rnd=new > file.txt
Buried deep somewhere in the code.

But yeah I don't see any reason why you couldn't theoretically make a reproducible build with Docker.

Re:LXC vs. Docker by MD87 on Friday February 18, 2022 @02:26PM (#30390005)
Docker images actually contain the timestamp each layer was built at, so are basically de-facto non-reproducible.

Buildah from Red Hat has an argument to set this programmatically instead of using the current date, but AFAIK there's no way to do that with plain old docker build.

Re:LXC vs. Docker by gmfawcett on Friday February 18, 2022 @02:39PM (#30390155)
The nixpkgs workaround is to build images with build-date == 1970-01-01. Annoying but reproducible.
Re:LXC vs. Docker by tra3 on Friday February 18, 2022 @02:43PM (#30390189)
If you have dynamism like this in your build, doesn't that imply that no build system is reproducible?
Re:LXC vs. Docker by Ajedi32 on Monday February 21, 2022 @10:18AM (#30416768)
My point was just that Docker doesn't ensure reproducibility. Whether a build is reproducible or not depends on the steps used, so its possible but not "ensured".

If you wanted to guarantee reproducibility, a hypothetical purely-functional build system could do that. I personally don't think that's necessary though, or that it would be worth the requisite trade-offs.

Re:LXC vs. Docker by amarshall on Friday February 18, 2022 @08:43PM (#30393640)
Yes, but previous commenter said

> I [thought] Dockerfile ensured that builds are indeed reproducible?

The example straightforwardly disproves that.

Re:LXC vs. Docker by mlrhazi on Friday February 18, 2022 @06:36PM (#30392686)
Would that not be cached? It would not actually run that date command again, right? unless you change that date line itself, in the Dockerfile.
Re:LXC vs. Docker by amarshall on Friday February 18, 2022 @08:41PM (#30393624)
If you’re using a cached version, you haven’t really reproduced anything but the cache itself. Reproducibility means creating the same output given the same input, every time, regardless of some local cache.

That said, the above example isn’t specific to Docker.

Re:LXC vs. Docker by anamexis on Friday February 18, 2022 @10:04PM (#30394047)
Or if you change anything that comes before that line.