terraform.tf
terraform { required_providers { docker = { source = "kreuzwerker/docker" version = "~> 3.0.2" } } required_version = "~> 1.7" }
main.tf
provider "docker" {} resource "docker_image" "nginx" { name = "nginx:latest" keep_locally = false } resource "docker_container" "nginx" { image = docker_image.nginx.image_id name = "tutorial" ports { internal = 80 external = 8000 } }