Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerTools: align generated layer archives with docker's output #58431

Merged
merged 2 commits into from Mar 27, 2019

Conversation

alexbiehl
Copy link
Contributor

@alexbiehl alexbiehl commented Mar 27, 2019

Motivation for this change

This PR makes docker images created by nix to be exactly the same as images created by docker. We encountered proprietary software that doesn't implement the full tar spec.

@shlevy @grahamc

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Alex Biehl added 2 commits March 27, 2019 11:35
To be totally consistent with the way Docker builds images we need to
include the /nix/store in the layer tarballs first.
@Mic92 Mic92 changed the title Alex/nix layers dockerTools: align generated layer archives with docker's output Mar 27, 2019
@nlewo
Copy link
Member

nlewo commented Mar 27, 2019

@GrahamcOfBorg test docker-tools

@grahamc grahamc merged commit 6af3176 into NixOS:master Mar 27, 2019
@alexbiehl alexbiehl deleted the alex/nix-layers branch March 27, 2019 21:21
shlevy pushed a commit that referenced this pull request Mar 27, 2019
dockerTools: align generated layer archives with docker's output
(cherry picked from commit 6af3176)
shlevy pushed a commit that referenced this pull request Mar 27, 2019
dockerTools: align generated layer archives with docker's output
(cherry picked from commit 6af3176)
danieldk added a commit to danieldk/nixpkgs that referenced this pull request Jun 6, 2019
PR NixOS#58431 added /nix/store to each layer.tar. However, the timestamp was
not explicitly set while adding /nix and /nix/store to the archive. This
resulted in different SHA256 hashes of layer.tar between image builds.

This change sets time and owner when tar'ing /nix/store.
nlewo pushed a commit that referenced this pull request Jun 6, 2019
PR #58431 added /nix/store to each layer.tar. However, the timestamp was
not explicitly set while adding /nix and /nix/store to the archive. This
resulted in different SHA256 hashes of layer.tar between image builds.

This change sets time and owner when tar'ing /nix/store.

(cherry picked from commit d7f3186)
alexbiehl pushed a commit to alexbiehl/nixpkgs that referenced this pull request May 24, 2020
In NixOS#58431 the authors ensured that
the resulting layer.tar would always list

  /nix/
  /nix/store/

first to fully comply to the tar spec. Various refactorings later it is only
ensured to create /nix/ but NOT /nix/store anymore. Instead tar transformed
them to /nix/nix and /nix/nix/store.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants