Skip to content

Instantly share code, notes, and snippets.

@Codesleuth
Last active September 7, 2021 10:21
Show Gist options
  • Save Codesleuth/79aee1487e81aca7a8814a4ca9c12f23 to your computer and use it in GitHub Desktop.
Save Codesleuth/79aee1487e81aca7a8814a4ca9c12f23 to your computer and use it in GitHub Desktop.
Create terraform-docs using docker command

Given a structure like:

/
  /terraform
    /environment
    /infra
  /other

For x86/64 machines:

docker run --rm \
  -v $(pwd):/data \
  -w /data/terraform/infra \
  quay.io/terraform-docs/terraform-docs:0.15.0 \
  markdown table . > README.md

For M1 Apple Silicon Mac, specify the platform:

docker run --rm \
  --platform linux/amd64 \
  -v $(pwd):/data \
  -w /data/terraform/infra \
  quay.io/terraform-docs/terraform-docs:0.15.0 \
  markdown table . > README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment