Terraform with Docker for Macbook M1 (ARM)
My intention is to blog how I build Terraform in a Docker image, compile it and run as "alias". Official docker image for Terraform do not provide ARM64 architecture at the point of writing this article. In addition to that, I wanted to play with Google Distroless image.
Step:1
Create a docker file with multiple build stage:
Step:2
Build the docker image, for my case, I intend to save the image in DockerHub hence I am running the following command:
"docker build -t wongchuinhun/terraform" and upload into my docker hub
Step: 3
I want to create an alias in my Macbook instead of typing the full docker command, hence I added the following in my zshrc file:
alias t = "docker run -it --rm wongchuinhun/terraform"
Step:4
To use it, I simple go to my terraform working folder and type the following code in my Terminal:
t init
Comments