Skip to content

Instantly share code, notes, and snippets.

@crazyrohila
Forked from hitsujiwool/docker.json
Created May 10, 2017 02:50
Show Gist options
  • Save crazyrohila/84c56556af807ddc7c7f23bb84aee4e3 to your computer and use it in GitHub Desktop.
Save crazyrohila/84c56556af807ddc7c7f23bb84aee4e3 to your computer and use it in GitHub Desktop.
docker + docker-compose on Amazon Linux
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}"
},
"builders": [
{
"type": "amazon-ebs",
"ssh_pty": true,
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "ap-northeast-1",
"source_ami": "ami-1c1b9f1c",
"instance_type": "t2.micro",
"ssh_username": "ec2-user",
"ami_name": "docker"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo yum install -y docker",
"sudo usermod -a -G docker ec2-user",
"sudo curl -L https://github.com/docker/compose/releases/download/1.4.0/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null",
"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