Since you are on AWS you can publish your image to ECR and use an instance profile with an IAM policy enabling read. I have a script which you can use to attach volumes by tags on boot using cloud init, cloudformation init, or plain UserData.
Your startup process when autoscaling would basically be:
- Log into ECR
- Attach EBS volume
- Start your Jenkins service which should assume it already has access to your data and Docker has ability to download from ECR.
Alternate, my preference is to bake AMIs using packer with everything preloaded onto the agent. This autoscaling enables indefinite cold failover. Here’s a diagram of the approach and I also have another diagram generically explaining how packer works.
The benefit of using Jenkins with Docker is it enables more testing versatility. I can provision a similar Jenkins instance in AWS or even just on my laptop for experiments.