-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
nixos/dockerTools: fix includeStorePaths when enableFakechroot #271976
nixos/dockerTools: fix includeStorePaths when enableFakechroot #271976
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a tests cases for such duplication in nixos/tests/docker-tools.nix
?
@@ -922,6 +922,7 @@ rec { | |||
--sort name \ | |||
--exclude=./proc \ | |||
--exclude=./sys \ | |||
${optionalString (!includeStorePaths) "--exclude=.${builtins.storeDir}"} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store paths should under no circumstance be added to the customization layer. That's what the other layers are for.
${optionalString (!includeStorePaths) "--exclude=.${builtins.storeDir}"} \ | |
--exclude=.${builtins.storeDir} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip! I've amended my commit to: f09b8484b3604beeaafae15c4e3d1170175da126 9be14e2f323c56c57e4fb034dd73720358370b84
About the nixos tests, I'm new to them; I'll try to add them this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a test, and fixed my breaking typo.
Hopefully the use of pkgs.crane
in the tests is ok, I had trouble finding a concise way of listing out the image files.
f09b848
to
9be14e2
Compare
9be14e2
to
22ee6de
Compare
After NixOS#268458, when setting `enableFakechroot = true` and `includeStorePaths = false`, some of the store paths were getting included into the image anyway, thru `bind-paths`. This resulted in unexpectedly large images. Now, the images will not contain any store paths under those circumstances.
22ee6de
to
8353fad
Compare
I've added added a few test cases so that the @ofborg test docker-tools |
@roberth Kind ping, I think this is ready to go in. |
@WxNzEMof thanks! |
Successfully created backport PR for |
Description of changes
After #268458, when setting
enableFakechroot = true
andincludeStorePaths = false
, some of the store paths were getting included into the image anyway, thrubind-paths
. This resulted in unexpectedly large images.Now, the images will not contain any store paths under those circumstances.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.