-
Notifications
You must be signed in to change notification settings - Fork 52
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
Build a graph of file trees before generating the tar stream #55
Conversation
Before this commit, nix2container read the file tree of store paths and write all file in the order they are walked by the os.Walk Go function. In this commit, the build process contains now two steps: 1. file trees are read and a graph representing these files is built 2. this graph is walk to write files to the tar stream This allows to easily transform the file tree (filename rewritting for instance) and also allow to easily detect duplicated files.
I tested with some of the big, troublesome images (e.g. This is huge for the community! Thanks @nlewo for your phenomenal work. |
@nktpro Nice, thx for your tests! |
Ugh, I just noticed there's a regression with For example: nix2container.buildImage
{
name = "netcat";
tag = netcat.version;
copyToRoot = [ dumb-init netcat bash ];
config = {
env = [
"PATH=/bin"
];
entrypoint = [ "dumb-init" "--" "nc" ];
};
} Will fail (on a typical Linux env) with:
|
Also added a copyToRoot test to ensure we can mix several directories together.
@nktpro it should be better now :) |
@nlewo I'm not sure which branch I should test again with that has the combined result of all your recent work? The |
@nlewo I'm not sure which branch I should test again with?
Ah sorry, i didn't have rebased the case-hack branch onto the new
tar-graph branch. That's now done.
|
Thanks @nlewo, that did it. Happy to report that I found no other issue or regression at this point. |
Unfortunately, it looks like testing this at work currently doesn't rally align with other urgencies. 😏 |
@blaggacao Thx for the update. So, let's move forward then! |
Before this commit, nix2container read the file tree of store paths and write all file in the order they are walked by the os.Walk Go function.
In this commit, the build process contains now two steps:
This allows to easily transform the file tree (filename rewritting for instance) and also allow to easily detect duplicated files.