Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero content from terraform-docs if i run it with docker #728

Open
lachnerd opened this issue Dec 7, 2023 · 1 comment
Open

zero content from terraform-docs if i run it with docker #728

lachnerd opened this issue Dec 7, 2023 · 1 comment
Labels

Comments

@lachnerd
Copy link

lachnerd commented Dec 7, 2023

Describe the bug

If i try to run terraform-docs with docker like:

docker run --rm --volume "$(pwd):/data" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.16.0 markdown /data > README.md

The file/result is always empty.

Otherwise if i try this with terraform-docs binary instead the container i'm getting solid documentation/content.

Whatr could be wrong or how to debug this.

I already created an image myself with only the terraform-docs binary in it: same result

Any ideas ?

Environment information

@lachnerd lachnerd added the bug label Dec 7, 2023
@khos2ow
Copy link
Member

khos2ow commented Dec 19, 2023

This is the normal behavior of docker run. If you omit > README.md at the end of the command above, whatever you see as a result of that command is not stdout of the terminal you are in, rather than the stdout of the container.

What you can do is to use --output-file README.md and use native save to file functionality of terraform-docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants