I am working through using the terraform docker image and I am curious why the plugins aren’t already in the image? It makes it so that the commands on the dockerhub page fail because terraform init needs to be run but since with the command the container in ephemeral, the commands will still fail because the plugins are gone on the next run.
A few ideas come to mind:
- plugins keep updating on their own, so the image would need constant update on Dockerhub ( )
- terraform supports loading plugins from specific directory, you should mount that into the container to make the plugins persist.
HTH!
plugins keep updating on their own, so the image would need constant update on Dockerhub
This seems ideal to me but understand it wouldn’t be for some.
terraform supports loading plugins from specific directory, you should mount that into the container to make the plugins persist.
yes, that is what I did but there is no mention of this on the dockerhub page. So maybe add that information to that page?
something along the lines of
plugin aren’t in the docker image set the data directory so plugins are persisted. e,g
docker run -it -e TF_DATA_DIR=${target}/.terraform ...
Regards,