Giter Site home page Giter Site logo

Comments (5)

mattmoor avatar mattmoor commented on May 23, 2024

This is all by design (which sounds horrible), let me explain.

The former is because we omit timestamps in the config files, and Docker picks some random time (not the Unix epoch) out of thin air.

Both are in pursuit of reproducible builds. I believe you'd also see the latter if you looked inside of a JAR file Bazel produces.

Ultimately the decision comes down to a trade-off between something largely cosmetic (timestamp) and something that fundamentally improves numerous things, including:

  1. Repeatable builds are the holy grail of provenance
  2. Same input => same layer means better distributed caching
  3. Same input => same layer means better push / pull incrementality

I could go on, but these are some of the highlights.

I think our best case would be for Docker to do something more sensible when this is omitted.

from rules_docker.

mattmoor avatar mattmoor commented on May 23, 2024

With stamping, we could allow timestamps to creep in, but Skylark doesn't yet support this well. What we have with stamp = true is essentially a workaround.

from rules_docker.

jimmidyson avatar jimmidyson commented on May 23, 2024

Your explanation re reproducible builds makes total sense - thank you again.

from rules_docker.

Globegitter avatar Globegitter commented on May 23, 2024

@mattmoor I now have an issue where I want to create a docker image with bazel installed. I now get it to install as discussed here: bazelbuild/bazel#4492

But now the problem is bazel itself checks the creation dates of those files and errors out with: Error: corrupt installation: file '/opt/bazel/_embedded_binaries/A-server.jar' modified. Please remove '/opt/bazel' and try again. I can run touch -m -t 202801010101 $(find /opt/bazel -type f) as a first command but that takes 6-8s, making it again less suitable for CI.

Seems like this issue could also be fixed with the stamping feature, by allowing a separate timestamp for tar extraction.

from rules_docker.

rbtcollins avatar rbtcollins commented on May 23, 2024

So, Docker are punting on this because OCI mandates it; and pointing at https://github.com/opencontainers/image-spec/issues as the place to push this forward.

from rules_docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.