Skip to content

Instantly share code, notes, and snippets.

@gravcat
Created April 27, 2018 20:29
Show Gist options
  • Save gravcat/06fa1add1f0da6c36183b2f7f866a8b5 to your computer and use it in GitHub Desktop.
Save gravcat/06fa1add1f0da6c36183b2f7f866a8b5 to your computer and use it in GitHub Desktop.
install docker so fast on an ec2 instance you won't know what to do with yourself
provisioner "remote-exec" {
inline = [
"sudo apt-get update -y",
"sudo apt-get upgrade -y",
"sudo apt install python2.7 -y",
"sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1",
"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 -y docker-ce"
]
connection {
type = "ssh"
private_key = "${file("~/.ssh/${var.key_pair_name}.pem")}"
user = "ubuntu"
timeout = "1m"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment