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

Ability to use a TempFile instead of an in-memory buffer for tarball snapshots to build large Docker containers? #358

Closed
nelsonjchen opened this issue Sep 16, 2018 · 5 comments
Labels

Comments

@nelsonjchen
Copy link

// TakeSnapshot takes a snapshot of the specified files, avoiding directories in the whitelist, and creates
// a tarball of the changed files. Return contents of the tarball, and whether or not any files were changed
func (s *Snapshotter) TakeSnapshot(files []string) ([]byte, error) {
buf := bytes.NewBuffer([]byte{})
filesAdded, err := s.snapshotFiles(buf, files)
if err != nil {
return nil, err
}
contents := buf.Bytes()
if !filesAdded {
return nil, nil
}
return contents, err
}

I'm interested in building multi-GB Docker images with Kaniko. Unfortunately, doing this immediately exhausts the RAM. I think this is because the snapshotting steps take a tarball snapshot of the whole filesystem in-memory.

It would be nice to have an option to tell kaniko to use a Tempfile for the snapshot backing.

@priyawadhwa
Copy link
Collaborator

@nelsonjchen this should be fixed with #428. I'll go ahead and close this issue, please comment or open another if you run into any more problems!

@nelsonjchen
Copy link
Author

nelsonjchen commented Nov 16, 2018

Woah! I didn't expect this to be resolved. "Have a bit of faith." - Some videogame I'm currently playing.

I look forward to trying this.

@lovetheguitar
Copy link

Hey,

sorry for the stupid question, but how do I enable this?
I'd like to build a 10+GB image from within Gitlab CI.
Thanks for any hints.

@nelsonjchen
Copy link
Author

nelsonjchen commented Jun 23, 2021

@lovetheguitar I would look at the code. Always look at the code. It's authoritative. Check out the PR that was merged and mentioned above. Apparently, you don't have to do anything except provide disk space.

@lovetheguitar
Copy link

@lovetheguitar I would look at the code. Always look at the code. It's authoritative. Check out the PR that was merged and mentioned above. Apparently, you don't have to do anything except provide disk space.

Thanks for your answer. Yeah, I tried, but I don't know go at all.
Either way it appears to be a different bug #909.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants