2
votes

I'm trying to create a Packer AMI image for EC2 based off of CentOS 7. I'm able to get provisioning working just fine, I can upgrade and install packages without a hitch.

The problem I'm having is that the Docker daemon won't start, and I need it running at build time to be able to bake some Docker images onto the machine.

Is there a way to acquire an interactive shell to the EC2 build instance during the Packer build so I can debug what is going wrong with it? Until I figure out what is failing, I can't finish my work on this AMI.

1
I've never had the need to do so, but can't you just add one sleep 1200 into provision script, and ssh into instance while it is waiting?Dusan Bajic

1 Answers

3
votes

Pass the -debug option to packer build:

packer build -debug something.json

This will cause packer to pause between steps, emit an IP address and a generated PEM certificate.

You can then do ssh -i ec2_generated_key.pem centos@IP and get into the box.