From 3504274217f8e3ede774831919f71dcbf072d225 Mon Sep 17 00:00:00 2001 From: Jimmy Briggs Date: Wed, 13 Oct 2021 19:23:52 -0400 Subject: [PATCH] feat: first example provisioning a local docker container --- 1-terraform-docker-container/README.md | 0 1-terraform-docker-container/main.tf | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 1-terraform-docker-container/README.md create mode 100644 1-terraform-docker-container/main.tf diff --git a/1-terraform-docker-container/README.md b/1-terraform-docker-container/README.md new file mode 100644 index 0000000..e69de29 diff --git a/1-terraform-docker-container/main.tf b/1-terraform-docker-container/main.tf new file mode 100644 index 0000000..172fe60 --- /dev/null +++ b/1-terraform-docker-container/main.tf @@ -0,0 +1,24 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "~> 2.15.0" + } + } +} + +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 + } +}