2

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.

Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
  • 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 Dec 30 '15 at 22:58

1 Answers1

3

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.

Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411