You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Implement using of buildx for docker_image (#717)
* feat: Implement using of buildx for docker_image
* fix: secrets in docker_image
* fix: fmt issues
* test: Add test for build_log_file
* chore: Disable flaky test and update goreleaser to exclude not possible build
* feat: Small refactoring and documentation improvements
You can also use the resource to build an image. By default the build block is using the old legacy docker build. In order to use a buildx builder, please read the section below
47
47
48
48
-> **Note**: The default timeout for the building is 20 minutes. If you need to increase this, you can use [operation timeouts](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts).
-> **Note**: The buildx feature is currently in preview and may have some quirks. Known issues: Setting `ulimits` will not work.
87
+
88
+
The `build` argument uses the legacy docker builder. If you want to use a buildx builder, you need to set the `builder` argument. For the default buildx builder, you can set the `builder` argument to `default`. For a custom buildx builder, you can set the `builder` argument to the name of the builder. You can find the name of the builder by running `docker buildx ls`.
89
+
90
+
The single platform build result is automatically loaded to `docker images`.
91
+
84
92
<!-- schema generated by tfplugindocs -->
85
93
## Schema
86
94
@@ -116,6 +124,8 @@ Optional:
116
124
-`auth_config` (Block List) The configuration for the authentication (see [below for nested schema](#nestedblock--build--auth_config))
117
125
-`build_args` (Map of String) Pairs for build-time variables in the form of `ENDPOINT : "https://example.com"`
118
126
-`build_id` (String) BuildID is an optional identifier that can be passed together with the build request. The same identifier can be used to gracefully cancel the build with the cancel request.
127
+
-`build_log_file` (String) Path to a file where the buildx log are written to. Only available when `builder` is set. If not set, no logs are available. The path is taken as is, so make sure to use a path that is available.
128
+
-`builder` (String) Set the name of the buildx builder to use. If not set or empty, the legacy builder will be used.
119
129
-`cache_from` (List of String) Images to consider as cache sources
120
130
-`cgroup_parent` (String) Optional parent cgroup for the container
121
131
-`cpu_period` (Number) The length of a CPU period in microseconds
@@ -135,9 +145,9 @@ Optional:
135
145
-`no_cache` (Boolean) Do not use the cache when building the image
136
146
-`platform` (String) Set platform if server is multi-platform capable
137
147
-`pull_parent` (Boolean) Attempt to pull the image even if an older image exists locally
138
-
-`remote_context` (String) A Git repository URI or HTTP/HTTPS context URI
148
+
-`remote_context` (String) A Git repository URI or HTTP/HTTPS context URI. Will be ignored if `builder` is set.
139
149
-`remove` (Boolean) Remove intermediate containers after a successful build. Defaults to `true`.
140
-
-`secrets` (Block List) Set build-time secrets (see [below for nested schema](#nestedblock--build--secrets))
150
+
-`secrets` (Block List) Set build-time secrets. Only available when you use a buildx builder. (see [below for nested schema](#nestedblock--build--secrets))
141
151
-`security_opt` (List of String) The security options
142
152
-`session_id` (String) Set an ID for the build session
143
153
-`shm_size` (Number) Size of /dev/shm in bytes. The size must be greater than 0
@@ -176,7 +186,7 @@ Required:
176
186
Optional:
177
187
178
188
-`env` (String) Environment variable source of the secret
179
-
-`src` (String) File source of the secret
189
+
-`src` (String) File source of the secret. Takes precedence over `env`
0 commit comments