Deploying Docker Images Using Terraform

Deploying Docker Images Using Terraform
Written by Abhishek JalanApril 18, 2020
1 min read
Terraform
6 VIEWS 1 LIKES 0 DISLIKES SHARE
1 LIKES 0 DISLIKES 6 VIEWS SHARE
Abhishek Jalan

Founder of Wikiance, DevOps Engineer

We're going to create a Terraform file that deploys a Nginx Docker image.

Create a Terraform File

Create main.tf:

vi main.tf

main.tf:
resource "docker_image" "nginx_image" {
name = "nginx:latest"
}

Initialize Terraform

terraform init

Plan the Deployment

Execute terraform plan:

terraform plan -out=tf_image_plan

Apply the Terraform Plan

Apply the plan:

terraform apply tf_image_plan
Docker
DevOps
Terraform
6 VIEWS 1 LIKES 0 DISLIKES SHARE
1 LIKES 0 DISLIKES 6 VIEWS SHARE
Was this blog helpful?
You must be Logged in to comment
Code Block
Abhishek Jalan
Founder of Wikiance, DevOps Engineer
14 Blog Posts
4 Discussion Threads
Trending Categories
37
Software1
DevOps15
Frontend Development4
Backend Development2
Server Administration1
Linux Administration5
Data Center0
Sentry0
Terraform2
Ansible0
Docker3
Penetration Testing0
Kubernetes0
NGINX0
JenkinsX0
Jenkins2
SSL0
Ethical-Hacking1
Python0
NodeJs1
RedHat0
Github0
AngularJs0
Google Cloud Platform (GCP)0
SonarQube0
Amazon Web Service (AWS)0
VMware0
Blockchain0
Snipe-IT1
MongoDB0