Using Docker for running command-line tools
Up to now in this chapter, we have studied use cases of Docker to containerize a web application with Nginx.
Another use case of Docker is to be able to run command-line tools that are in Docker containers.
To illustrate this, we will run a sample of Terraform configuration using the Terraform binary, which is not located on a local machine but in a Docker container.
The Terraform configuration that we use in this section is the same as that in the previous section, Deploying a container to ACI with a CI/CD pipeline, and the source code is available here: https://github.com/PacktPublishing/Learning-DevOps-Second-Edition/tree/main/CHAP09/terraform-aci.
The goal of this lab is to run this Terraform configuration using the Terraform binary that is in the Docker container. To run this lab, following these steps:
- First we pull the official Terraform image from the Docker Hub with this command:
docker pull hashicorp/terraform...