mchirico / zDaily

Playground to hack and test ideas with Zoe
1 stars 2 forks source link

Day 97: Terraform #106

Open mchirico opened 3 years ago

mchirico commented 3 years ago

Day 97 Video

Reference

install

terraform init
# Answer 'yes' below
terraform apply
# Now to get rid of it
terraform destroy

Create main.tf

terraform {
  required_providers {
    docker = {
      source = "terraform-providers/docker"
    }
  }
}

provider "docker" {}

resource "docker_image" "nginx" {
  name         = "nginx:latest"
  keep_locally = false
}

resource "docker_container" "nginx" {
  image = docker_image.nginx.latest
  name  = "tutorial"
  ports {
    internal = 80
    external = 8000
  }
}
tacomonkautobot[bot] commented 3 years ago

mchirico, Thanks for opening this issue!