Newbie here, trying to figure out how to build both a docker image and an
amazon-ebs ami from the same script. Here I have stripped it down to the
essentials:
{
"builders": [
{
"type": "amazon-ebs",
"ami_name": "my-ami",
"instance_type": "t2.micro",
"region": "us-east-1",
"source_ami": "ami-f4cc1de2",
"ssh_username": "ubuntu"
},
{
"type": "docker",
"image": "ubuntu:16.04"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sleep 30",
"sudo apt-get update"
]
}
]
}
The problem is the "apt-get update" command...
If I do not include sudo, the docker build works but the amazon-ebs ami
fails to provision with "Permission denied" errors.
If I do include the sudo, the amazon-ebs build works but the docker build
fails with "sudo: not found ". How to solve this?
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/a17dff65-ef29-4c88-853d-d32fcc9df357%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.