hashicorp / packer-plugin-lxc

Packer plugin for LXC Builder
https://www.packer.io/docs/builders/lxc
Mozilla Public License 2.0
7 stars 7 forks source link

Configure rootfs export to not include `rootfs/` in the output .tar.gz #7

Open awygle opened 3 years ago

awygle commented 3 years ago

Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

I am using Packer to provision container templates for a Proxmox VE instance, and Proxmox expects that the input .tar.gz file containing the rootfs be "direct", for lack of a better word. That is, /bin/, /dev/, and the like should be at the top level of the archive rather than contained inside of a /rootfs/ folder.

Obviously I can work around this by doing a post-process step, but it's a bit cumbersome. I'd like a way to configure the export step which lets me solve this use case. (I'm assuming this needs to be more general than something to solve this very specific case, but maybe not.)

Use Case(s)

Proxmox containers is my current use case, although I'd not be surprised to learn there is other LXC-based infrastructure that has this same problem.

Potential configuration

Not really sure. Maybe adding a key like this to the builder config?

archive_directory = $containerDir/rootfs

That syntax definitely needs some work.

Potential References

landorg commented 1 year ago

@awygle hi :) Could you please explain how you create rootfs images with packer with a short example? I'd need something similar for Images for my hosting provider and can't figure out how to do than. Thanks