hashicorp / hashicorp/packer-plugin-docker
RFE: Layered container images using Docker Builder
- Dominant language
- Go
- Stars
- 40
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
_This issue was originally opened by @maxking as hashicorp/packer#6000. It was migrated here as a result of the [Packer plugin split](###blog-post-url###). 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][1] @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?
[1]: https://github.com/hashicorp/packer/issues/5972#issuecomment-370593587
Contributor guide
Assessment
This issue has not been assessed yet.