Skip to content

Instantly share code, notes, and snippets.

@andrewwatson
Created July 15, 2015 20:08
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 andrewwatson/deb53c5367533e3dfe6b to your computer and use it in GitHub Desktop.
Save andrewwatson/deb53c5367533e3dfe6b to your computer and use it in GitHub Desktop.
running docker machine and docker from terraform local-exec
provisioner "local-exec" {
command = "docker-machine create -d generic --generic-ssh-user=ubuntu --generic-ip-address=${self.public_ip} --generic-ssh-key ${var.key_path} --engine-opt dns=172.17.42.1 --engine-opt dns-search=service.consul discovery-${count.index}"
}
provisioner "local-exec" {
command = "docker --tlsverify --tlscacert=\"$HOME/.docker/machine/machines/discovery-${count.index}/ca.pem\" --tlscert=\"$HOME/.docker/machine/machines/discovery-${count.index}/cert.pem\" --tlskey=\"$HOME/.docker/machine/machines/discovery-${count.index}/key.pem\" -H=tcp://${self.public_ip}:2376 ps"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment