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

RFE: Layered container images using Docker Builder #15

Open
ghost opened this issue Mar 19, 2021 · 2 comments
Open

RFE: Layered container images using Docker Builder #15

ghost opened this issue Mar 19, 2021 · 2 comments
Labels
builder/docker stage/thinking Flagged for internal discussions about possible enhancements.

Comments

@ghost
Copy link

ghost commented Mar 19, 2021

This issue was originally opened by @maxking as hashicorp/packer#6000. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


This feature request follows from hashicorp/packer#5972 for allowing one layer per-provisioner in docker builder, so that we have some opportunity to optimize the container image for sharing layers.

I spent some time hacking on trying to implement a suggestion from @mwhooker but hit a snag when I realized that just changing the HookedProvisioner to something that commits after each provisioner wouldn't work and it would instead result in multiple images, produced after each provisioner ran and sharing no layers.

If I understand correctly, packer runs the base image, provisions it and then commits to an image. To achieve layering, I assume that we'd have to run a provisioner, commit the image and then teardown the entire thing and re-do the StepRun and StepConnect using the image committed in the previous step.

I just wanted to open this issue to discuss what you'd is the best way to achieve this, before I go around making too many intrusive changes?

@ghost ghost added builder/docker stage/thinking Flagged for internal discussions about possible enhancements. labels Mar 19, 2021
@michellelynne
Copy link

I would also like one layer per provisioner, since I am running into the "layers too large at 10GB" where the push will fail. I'm wondering why this closed and if there is another ticket I should be following? My work around is to string together multiple builds.

@colearendt
Copy link

This would be super useful to improve build time for docker images while iterating on a build. In particular, docker can often be a useful "dev" target for other builders (AMIs, etc.). In that context, where a build is happening on a laptop / etc., caching can be a game changer for speed / cycle time on iterations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builder/docker stage/thinking Flagged for internal discussions about possible enhancements.
Projects
None yet
Development

No branches or pull requests

2 participants