Skip to content

Instantly share code, notes, and snippets.

@Puneeth-n
Forked from fmarten/docker-compose.json
Created July 26, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Puneeth-n/1d52456c2143b1f597906eb0d5ac48ea to your computer and use it in GitHub Desktop.
Save Puneeth-n/1d52456c2143b1f597906eb0d5ac48ea to your computer and use it in GitHub Desktop.
Packer Template for Ubuntu 16.04 with Docker Compose as Amazon Machine Image (AMI)
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}"
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "eu-central-1",
"source_ami_filter": {
"filters": {
"name": "*ubuntu-xenial-16.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "Ubuntu 16.04 with Docker Compose",
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y",
"sudo groupadd docker",
"sudo gpasswd -a ubuntu docker",
"curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -",
"sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\"",
"sudo apt-get update && sudo apt-get install docker-ce -y",
"sudo curl -L \"https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose",
"sudo chmod +x /usr/local/bin/docker-compose"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment