Skip to content

Instantly share code, notes, and snippets.

@mcouthon mcouthon/Dockerfile
Created Jul 24, 2019

Embed
What would you like to do?
Simple Dockerfile to work with Terraform

To run TF code, put the Dockerfile into the same folder that has your TF file(s) in it, and run (from inside the folder):

docker build --pull -t tf_docker .

docker run -i --rm tf_docker
# Use the light version of the image that contains just the latest binary
FROM hashicorp/terraform:light
# The app folder will contain all our files
WORKDIR /app
# Put all your configration files in the same folder as the Dockerfile
COPY . /app
# Initalize terraform with local settings and data
RUN ["terraform", "init"]
# Plan and execute the configurations
CMD [ "apply"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.