Skip to content

Instantly share code, notes, and snippets.

@hitsujiwool
Created September 15, 2015 06:20
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save hitsujiwool/81fcab49f9ccf8ac5835 to your computer and use it in GitHub Desktop.
Save hitsujiwool/81fcab49f9ccf8ac5835 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"
]
}
]
}
@omarabid
Copy link

omarabid commented Jun 4, 2016

This doesn't get you the latest version of Docker Compose, plus you should use the "/usr/bin" directory as the "/usr/local/bin" directory is not included in AWS Path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment