Skip to content

Instantly share code, notes, and snippets.

@derekm1215
Created March 29, 2018 06:57
Show Gist options
  • Save derekm1215/f8d666d51e475f208acb1def01351d72 to your computer and use it in GitHub Desktop.
Save derekm1215/f8d666d51e475f208acb1def01351d72 to your computer and use it in GitHub Desktop.
# Download the latest Ghost Image
resource "docker_image" "image_id" {
name = "ghost:latest"
}
# Start the Container
resource "docker_container" "container_id" {
name = "blog"
image = "${docker_image.image_id.latest}"
ports {
internal = "2368"
external = "80"
}
}
#Output the IP Address of the Container
output "IP Address" {
value = "${docker_container.container_id.ip_address}"
}
output "container_name" {
value = "${docker_container.container_id.name}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment