hashicorp / docker-hub-images

Automatic builds of container images for Docker Hub
Mozilla Public License 2.0
127 stars 111 forks source link

The Terraform example at DockerHub is outdated #58

Closed TG9541 closed 5 years ago

TG9541 commented 6 years ago

Problem:

The example usage at https://hub.docker.com/r/hashicorp/terraform/ is outdated, which is likely to frustrate beginners.

How to reproduce it: Using docker run -i -t hashicorp/terraform:light plan main.tf results in sessions like following:

thomas@w500:~/source/terraform$ ls -l
total 8
-rw-rw-r-- 1 thomas thomas 2331 Jun  3 10:12 account.json
-rw-rw-r-- 1 thomas thomas  937 Jun  3 10:14 main.tf
thomas@w500:~/source/terraform$ docker run -it hashicorp/terraform:light version
Terraform v0.11.7

thomas@w500:~/source/terraform$ docker run -it hashicorp/terraform:light plan main.tf
Failed to load Terraform configuration or plan: open main.tf: no such file or directory

The solution is to follow the examples in the GitHub README.md.

Proposed solution: Please edit the docs at DockerHub, remove the broken example, and point to the up-to-date docs at GitHub instead.

christhomas commented 6 years ago

Why is this not fixed yet? It seems like a very easy to solve problem?

paultyng commented 5 years ago

We no longer build Terraform docker images from this repository (Packer images are built here still).

Issues and pull requests on the Terraform docker image should be opened on the main Terraform repository: https://github.com/hashicorp/terraform

Curtis017 commented 5 years ago

@TG9541 that README.md link is broken. Could you please provide the solution in this thread. I would like to use the docker image to run plans. 😄

deenski commented 5 years ago

@Curtis017 Solution: https://github.com/hashicorp/terraform#docker

jasong1978 commented 5 years ago

From where can I pull the new light docker image?

wedneyyuri commented 5 years ago

Solution: mount the volume and overwrite the working directory. Example:

docker run -it -v $(pwd):/workpace -w /workpace hashicorp/terraform:0.12.2 apply