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: Properly add /nix/ and /nix/store/ first to layer.tar #88762

Merged
merged 1 commit into from May 24, 2020

Conversation

alexbiehl
Copy link
Contributor

@alexbiehl alexbiehl commented May 24, 2020

Motivation for this change

In #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.

To verify the change works I built several images, tested them on Docker and some very picky proprietary software working with Docker images.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@FRidh
Copy link
Member

FRidh commented May 24, 2020

We should not hardcode /nix/store. Instead, use builtins.storeDir for portability.

@alexbiehl
Copy link
Contributor Author

I agree. But I think that is a bigger sweep as we hard code and assume /nix/store in several places in the docker builder. I suggest to get this patch in to fix the issue at hand and tackle the rewrite to builtins.storeDir in the next patch.

@Mic92 Mic92 changed the title Properly add /nix/ and /nix/store/ first the the tarball dockerTools: Properly add /nix/ and /nix/store/ first the the tarball 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.
@alexbiehl alexbiehl changed the title dockerTools: Properly add /nix/ and /nix/store/ first the the tarball dockerTools: Properly add /nix/ and /nix/store/ first to layer.tar May 24, 2020
@shlevy shlevy merged commit fffa6e8 into NixOS:master May 24, 2020
@alexbiehl alexbiehl deleted the alex/docker-tools branch May 24, 2020 12:36
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

3 participants