terraform-demo icon indicating copy to clipboard operation
terraform-demo copied to clipboard

Compile terraform from source in the docker container

Open funkymonkeymonk opened this issue 10 years ago • 3 comments

In an effort to always keep the version of terraform in the Dockerfile up to date, I would like to switch from using the precompiled binaries to compiling from source.

funkymonkeymonk avatar Aug 12 '14 15:08 funkymonkeymonk

Sounds like the worst idea ever, to be honest. You are likely to run into all sorts of issues with this if it's used in production sort of environment. Best to have a CI system that uploads tested binaries to some reliable place.

errordeveloper avatar Aug 26 '14 22:08 errordeveloper

Thanks for your input. The docker container is simply a means to test terraform without having it installed locally and allow me to use the latest enhancements before a new version is cut. If you are looking for a stable binary they are already provided by the terraform project. Also I don't know if I would reccomend using tech demo code for an alpha application in production.

That being said, personally I would put the CI enviornment after the creation of the Dockerfile and have the Dockerfile compile the code from scratch each time. Then the container can be tested as a whole unit instead. This ensures that terraform will operate the same way regardless of where it is deployed as it is being run in an encapsulated enviornment.


edited for grammer

funkymonkeymonk avatar Aug 26 '14 22:08 funkymonkeymonk

Looks like https://github.com/uzyexe/dockerfile-terraform is already fulfilling this need. I'll write a simple bash script around this container instead possibly checking to see if terraform is already installed locally first.

funkymonkeymonk avatar Feb 06 '15 04:02 funkymonkeymonk