Tiny Docker image for terraform-docs in multiple versions to be used for CI and other automations
1M+
terraform-docsAll #awesome-ci Docker images
ansible-lint • ansible • awesome-ci • bandit • black • checkmake • eslint • file-lint • gofmt • goimports • golint • jsonlint • kubeval • linkcheck • mypy • php-cs-fixer • phpcbf • phpcs • phplint • pycodestyle • pydocstyle • pylint • terraform-docs • terragrunt-fmt • terragrunt • yamlfmt • yamllint
View Dockerfiles on GitHub.
Available Architectures: amd64, i386, arm64, arm/v7, arm/v6
Tiny Alpine-based multistage-build dockerized version of terraform-docs[1],
which additionally implements terraform-docs-replace allowing you to automatically and safely
replace the terraform-docs generated output infile.
Furthermore this implementation is also Terraform >= 0.12 ready[2]. See Generic Usage for more details.
The image is built nightly against multiple stable versions and pushed to Dockerhub.
The following Docker image tags are rolling releases and are built and updated every night.
| Docker Tag | Git Ref | Terraform Docs | Available Architectures |
|---|---|---|---|
latest | master | latest | amd64, i386, arm64, arm/v7, arm/v6 |
0.16.0 | master | 0.16.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.15.0 | master | 0.15.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.14.1 | master | 0.14.1 | amd64, i386, arm64, arm/v7, arm/v6 |
0.14.0 | master | 0.14.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.13.0 | master | 0.13.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.12.1 | master | 0.12.1 | amd64, i386, arm64, arm/v7, arm/v6 |
0.12.0 | master | 0.12.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.11.2 | master | 0.11.2 | amd64 |
0.11.1 | master | 0.11.1 | amd64 |
0.11.0 | master | 0.11.0 | amd64 |
0.10.1 | master | 0.10.1 | amd64 |
0.10.0 | master | 0.10.0 | amd64 |
0.9.1 | master | 0.9.1 | amd64 |
0.9.0 | master | 0.9.0 | amd64 |
0.8.2 | master | 0.8.2 | amd64 |
0.8.1 | master | 0.8.1 | amd64 |
0.8.0 | master | 0.8.0 | amd64 |
0.7.0 | master | 0.7.0 | amd64 |
0.6.0 | master | 0.6.0 | amd64 |
0.5.0 | master | 0.5.0 | amd64 |
0.4.5 | master | 0.4.5 | amd64 |
0.4.0 | master | 0.4.0 | amd64 |
0.3.0 | master | 0.3.0 | amd64 |
0.2.0 | master | 0.2.0 | amd64 |
0.1.1 | master | 0.1.1 | amd64 |
0.1.0 | master | 0.1.0 | amd64 |
The following Docker image tags are built once and can be used for reproducible builds. Its version never changes so you will have to update tags in your pipelines from time to time in order to stay up-to-date.
| Docker Tag | Git Ref | Terraform Docs | Available Architectures |
|---|---|---|---|
latest-0.32 | tag: 0.32 | latest | amd64, i386, arm64, arm/v7, arm/v6 |
0.16.0-0.32 | tag: 0.32 | 0.16.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.15.0-0.32 | tag: 0.32 | 0.15.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.14.1-0.32 | tag: 0.32 | 0.14.1 | amd64, i386, arm64, arm/v7, arm/v6 |
0.14.0-0.32 | tag: 0.32 | 0.14.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.13.0-0.32 | tag: 0.32 | 0.13.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.12.1-0.32 | tag: 0.32 | 0.12.1 | amd64, i386, arm64, arm/v7, arm/v6 |
0.12.0-0.32 | tag: 0.32 | 0.12.0 | amd64, i386, arm64, arm/v7, arm/v6 |
0.11.2-0.32 | tag: 0.32 | 0.11.2 | amd64 |
0.11.1-0.32 | tag: 0.32 | 0.11.1 | amd64 |
0.11.0-0.32 | tag: 0.32 | 0.11.0 | amd64 |
0.10.1-0.32 | tag: 0.32 | 0.10.1 | amd64 |
0.10.0-0.32 | tag: 0.32 | 0.10.0 | amd64 |
0.9.1-0.32 | tag: 0.32 | 0.9.1 | amd64 |
0.9.0-0.32 | tag: 0.32 | 0.9.0 | amd64 |
0.8.2-0.32 | tag: 0.32 | 0.8.2 | amd64 |
0.8.1-0.32 | tag: 0.32 | 0.8.1 | amd64 |
0.8.0-0.32 | tag: 0.32 | 0.8.0 | amd64 |
0.7.0-0.32 | tag: 0.32 | 0.7.0 | amd64 |
0.6.0-0.32 | tag: 0.32 | 0.6.0 | amd64 |
0.5.0-0.32 | tag: 0.32 | 0.5.0 | amd64 |
0.4.5-0.32 | tag: 0.32 | 0.4.5 | amd64 |
0.4.0-0.32 | tag: 0.32 | 0.4.0 | amd64 |
0.3.0-0.32 | tag: 0.32 | 0.3.0 | amd64 |
0.2.0-0.32 | tag: 0.32 | 0.2.0 | amd64 |
0.1.1-0.32 | tag: 0.32 | 0.1.1 | amd64 |
0.1.0-0.32 | tag: 0.32 | 0.1.0 | amd64 |
The following Docker environment variables are available. These will only need to be used when
using terraform-docs-replace or terraform-docs-replace-012.
| Variable | Default | Required | Comment |
|---|---|---|---|
| DELIM_START | <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | No | The starting delimiter in the file in where you want to replace the terraform-docs output. |
| DELIM_CLOSE | <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | No | The ending delimiter in the file in where you want to replace the terraform-docs output. |
The working directory inside the Docker container is /data/ and should be mounted locally to
where your Terraform module is located.
Usage: cytopia/terraform-docs terraform-docs <ARGS> .
cytopia/terraform-docs terraform-docs-012 <ARGS> .
cytopia/terraform-docs terraform-docs-replace <ARGS> <PATH-TO-FILE>
cytopia/terraform-docs terraform-docs-replace-012 <ARGS> <PATH-TO-FILE>
terraform-docs Output as expected from terraform-docs
terraform-docs-012 Same as above, but used for Terraform >= 0.12 modules
terraform-docs-replace Replaces directly inside README.md, if DELIM_START and DELIM_CLOSE are found.
terraform-docs-replace-012 Same as above, but used for Terraform >= 0.12 modules
<ARGS> All arguments terraform-docs command can use.
<PATH-TO-FILE> File in where to auto-replace terraform-docs block.
Create markdown output and sent to stdout:
# [Terraform < 0.12]
docker run --rm \
-v $(pwd):/data \
cytopia/terraform-docs \
terraform-docs --sort-by-required md .
# [Terraform >= 0.12]
docker run --rm \
-v $(pwd):/data \
cytopia/terraform-docs \
terraform-docs-012 --sort-by-required md .
Create README.md with terraform-docs output:
# [Terraform < 0.12]
docker run --rm \
-v $(pwd):/data \
cytopia/terraform-docs \
terraform-docs --sort-by-required md . > README.md
# [Terraform >= 0.12]
docker run --rm \
-v $(pwd):/data \
cytopia/terraform-docs \
terraform-docs-012 --sort-by-required md . > README.md
Replace current terraform-docs blocks in README.md with current one in order to automatically
keep it up to date. For this to work, the terraform-docs information must be wrapped with the
following delimiter by default:
README.md:
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs
...
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
# [Terraform < 0.12]
# Path to README.md must be specified as last command.
# Note that the command changes from terraform-docs to terraform-docs-replace
docker run --rm \
-v $(pwd):/data \
cytopia/terraform-docs \
terraform-docs-replace --sort-by-required md README.md
# [Terraform >= 0.12]
# Path to README.md must be specified as last command.
# Note that the command changes from terraform-docs to terraform-docs-replace
docker run --rm \
-v $(pwd):/data \
cytopia/terraform-docs \
terraform-docs-replace-012 --sort-by-required md README.md
You are able to use different delimiter. Let's imagine the following delimiter:
INFO.md:
<!-- TFDOC_START -->
## Inputs
...
<!-- TFDOC_END -->
# [Terraform < 0.12]
# Path to INFO.md must be specified as last command.
# Note that the command changes from terraform-docs to terraform-docs-replace
docker run --rm \
-v $(pwd):/data \
-e DELIM_START='<!-- TFDOC_START -->' \
-e DELIM_CLOSE='<!-- TFDOC_END -->' \
cytopia/terraform-docs \
terraform-docs-replace --sort-by-required md INFO.md
# [Terraform >= 0.12]
# Path to INFO.md must be specified as last command.
# Note that the command changes from terraform-docs to terraform-docs-replace
docker run --rm \
-v $(pwd):/data \
-e DELIM_START='<!-- TFDOC_START -->' \
-e DELIM_CLOSE='<!-- TFDOC_END -->' \
cytopia/terraform-docs \
terraform-docs-replace-012 --sort-by-required md INFO.md
Find below some example projects how this Docker image is used in CI to verify if the README.md has
been updated with the latest changes generated from terraform-docs:
Save yourself from installing lot's of dependencies and pick a dockerized version of your favourite linter below for reproducible local or remote CI tests:
| GitHub | DockerHub | Type | Description |
|---|---|---|---|
| awesome-ci | Basic | Tools for git, file and static source code analysis | |
| file-lint | Basic | Baisc source code analysis | |
| linkcheck | Basic | Search for URLs in files and validate their HTTP status code | |
| ansible | Ansible | Multiple versions and flavours of Ansible | |
| ansible-lint | Ansible | Lint Ansible | |
| gofmt | Go | Format Go source code [1] | |
| goimports | Go | Format Go source code [1] | |
| golint | Go | Lint Go code | |
| eslint | Javascript | Lint Javascript code | |
| jsonlint | JSON | Lint JSON files [1] | |
| kubeval | K8s | Lint Kubernetes files | |
| checkmake | Make | Lint Makefiles | |
| phpcbf | PHP | PHP Code Beautifier and Fixer | |
| phpcs | PHP | PHP Code Sniffer | |
| phplint | PHP | PHP Code Linter [1] | |
| php-cs-fixer | PHP | PHP Coding Standards Fixer | |
| bandit | Python | A security linter from PyCQA | |
| black | Python | The uncompromising Python code formatter | |
| mypy | Python | Static source code analysis | |
| pycodestyle | Python | Python style guide checker | |
| pydocstyle | Python | Python docstyle checker | |
| pylint | Python | Python source code, bug and quality checker | |
| terraform-docs | Terraform | Terraform doc generator (TF 0.12 ready) [1] | |
| terragrunt | Terraform | Terragrunt and Terraform | |
| terragrunt-fmt | Terraform | terraform fmt for Terragrunt files [1] | |
| yamlfmt | Yaml | Format Yaml files [1] | |
| yamllint | Yaml | Lint Yaml files |
[1] Uses a shell wrapper to add enhanced functionality not available by original project.
Visit cytopia/makefiles for dependency-less, seamless project integration and minimum required best-practice code linting for CI. The provided Makefiles will only require GNU Make and Docker itself removing the need to install anything else.
Copyright (c) 2019 cytopia
Content type
Image
Digest
sha256:ae03f8d4f…
Size
13.6 MB
Last updated
9 months ago
docker pull cytopia/terraform-docs:0.13.0-0.37