@@ -25,6 +25,7 @@ View **[Dockerfile](https://github.com/cytopia/docker-terraform-docs/blob/master
25
25
Tiny Alpine-based multistage-build dockerized version of [ terraform-docs] ( https://github.com/segmentio/terraform-docs ) <sup >[ 1] </sup >,
26
26
which additionally implements ` terraform-docs-replace ` allowing you to automatically and safely
27
27
replace the ` terraform-docs ` generated output infile.
28
+ Furthermore this implementation is also ** Terraform >= 0.12 ready** . See [ Generic Usage] ( #generic ) for more details.
28
29
The image is built nightly against multiple stable versions and pushed to Dockerhub.
29
30
30
31
<sub >[ 1] Official project: https://github.com/segmentio/terraform-docs </sub >
@@ -58,28 +59,35 @@ using `terraform-docs-replace`.
58
59
59
60
## Docker mounts
60
61
61
- The working directory inside the Docker container is ` /docs / ` and should be mounted locally to
62
+ The working directory inside the Docker container is ` /data / ` and should be mounted locally to
62
63
where your Terraform module is located.
63
64
64
65
65
66
## Usage
66
67
67
68
#### Generic
68
69
``` bash
69
- Usage: docker run cytopia/terraform-docs terraform-docs < ARGS> .
70
- docker run cytopia/terraform-docs terraform-docs-replace < ARGS> < PATH-TO-FILE >
70
+ Usage: cytopia/terraform-docs terraform-docs < ARGS> .
71
+ cytopia/terraform-docs terraform-docs-012 < ARGS> .
71
72
72
- terraform-docs Output as expected from terraform-docs
73
- terraform-docs-replace Same as above, but replaces directly inside README.md
74
- if DELIM_START and DELIM_CLOSE are found.
75
- < ARGS> All arguments terraform-docs command can use.
73
+ cytopia/terraform-docs terraform-docs-replace < ARGS> < PATH-TO-FILE>
74
+ cytopia/terraform-docs terraform-docs-replace-012 < ARGS> < PATH-TO-FILE>
75
+
76
+
77
+ terraform-docs Output as expected from terraform-docs
78
+ terraform-docs-012 Same as above, but used for Terraform > = 0.12 modules
79
+
80
+ terraform-docs-replace Replaces directly inside README.md, if DELIM_START and DELIM_CLOSE are found.
81
+ terraform-docs-replace-012 Same as above, but used for Terraform > = 0.12 modules
82
+
83
+ < ARGS> All arguments terraform-docs command can use.
76
84
` ` `
77
85
78
86
# ### Output to stdout
79
87
Create markdown output and sent to stdout:
80
88
` ` ` bash
81
89
docker run --rm \
82
- -v $( pwd) :/docs \
90
+ -v $( pwd) :/data \
83
91
cytopia/terraform-docs \
84
92
--sort-inputs-by-required terraform-docs --with-aggregate-type-defaults md .
85
93
` ` `
@@ -88,7 +96,7 @@ docker run --rm \
88
96
Create README.md with ` terraform-docs` output:
89
97
` ` ` bash
90
98
docker run --rm \
91
- -v $( pwd) :/docs \
99
+ -v $( pwd) :/data \
92
100
cytopia/terraform-docs \
93
101
terraform-docs --sort-inputs-by-required --with-aggregate-type-defaults md . > README.md
94
102
` ` `
@@ -110,7 +118,7 @@ following delimiter by default:
110
118
# Path to README.md must be specified as last command.
111
119
# Note that the command changes from terraform-docs to terraform-docs-replace
112
120
docker run --rm \
113
- -v $( pwd) :/docs \
121
+ -v $( pwd) :/data \
114
122
cytopia/terraform-docs \
115
123
terraform-docs-replace --sort-inputs-by-required --with-aggregate-type-defaults md README.md
116
124
` ` `
@@ -130,7 +138,7 @@ You are able to use different delimiter. Let's imagine the following delimiter:
130
138
# Path to INFO.md must be specified as last command.
131
139
# Note that the command changes from terraform-docs to terraform-docs-replace
132
140
docker run --rm \
133
- -v $(pwd):/docs \
141
+ -v $(pwd):/data \
134
142
-e DELIM_START=' TFDOC_START' \
135
143
-e DELIM_CLOSE=' TFDOC_END' \
136
144
cytopia/terraform-docs \
@@ -166,7 +174,7 @@ _gen-main:
166
174
@echo "# Main module"
167
175
@echo "------------------------------------------------------------"
168
176
@if docker run --rm \
169
- -v $(CURRENT_DIR):/docs \
177
+ -v $(CURRENT_DIR):/data \
170
178
-e DELIM_START=' $( DELIM_START) ' \
171
179
-e DELIM_CLOSE=' $( DELIM_CLOSE) ' \
172
180
cytopia/terraform-docs:${TF_DOCS_VERSION} \
@@ -185,7 +193,7 @@ _gen-examples:
185
193
echo "# $${DOCKER_PATH}"; \
186
194
echo "------------------------------------------------------------"; \
187
195
if docker run --rm \
188
- -v $(CURRENT_DIR):/docs \
196
+ -v $(CURRENT_DIR):/data \
189
197
-e DELIM_START=' $( DELIM_START) ' \
190
198
-e DELIM_CLOSE=' $( DELIM_CLOSE) ' \
191
199
cytopia/terraform-docs:${TF_DOCS_VERSION} \
@@ -205,7 +213,7 @@ _gen-modules:
205
213
echo "# $${DOCKER_PATH}"; \
206
214
echo "------------------------------------------------------------"; \
207
215
if docker run --rm \
208
- -v $(CURRENT_DIR):/docs \
216
+ -v $(CURRENT_DIR):/data \
209
217
-e DELIM_START=' $( DELIM_START) ' \
210
218
-e DELIM_CLOSE=' $( DELIM_CLOSE) ' \
211
219
cytopia/terraform-docs:${TF_DOCS_VERSION} \
0 commit comments