FYI I created a previous post asking about windows support: Can I use packer to build my big windows container images or not?
I have big windows containers I need to build
I want to have packer create an EC2 instance (the official windows ECS ami which has docker installed) and build a windows docker image and then push to ECR
BUT Im wondering if there is a way to “keep” that EC2 instance around until Im done?
So Im thinking the workflow would be like this:
- Modify the dockerfile
- Run packer build
- Packer provisions a new EC2 instance, builds the image, pushes to EC2, but doesn’t delete the instance
- Modify dockerfile more
- Run packer build again
- Packer uses the same instance to build and push
- When Im done working on the dockerfile I run a command like “packer destroy” or something? And then packer deletes the EC2 instance
Is a workflow like this possible? I ask because it would be faster if I didn’t need to have packer create a new instance each time it builds