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
Fix: calculation of Dockerfile path in docker_image build (#853)
* fix: Update dockerfile and context handling
* chore: Update documentation
* fix: Golangci lint error in testing code
* fix: formatting
* chore: Fix failing tests due to docker 29
* chore: Use 28.5.1 docker engine for tests
* fix: Improve docker swarm handling for tests
* fix: Use outputs from setup-docker step to set DOCKER_HOST env
* chore: Revert legacy docker build changes and switch to docker engine 28.0.4
* chore: Improve tests so that they do not fail
* fix: Revert maxfailureratio cange in docker service test
You can also use the resource to build an image. If you want to use a buildx builder with all of its features, 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).
49
49
50
50
In this case the image "zoo" and "zoo:develop" are built.
51
-
The `context` and `dockerfile` arguments are relative to the local Terraform process (`path.cwd`).
51
+
The `context` path is resolved on the machine running Terraform (relative paths are relative to the current working directory, i.e. `path.cwd`).
52
+
If `dockerfile` is not an absolute path, it is resolved relative to `context`.
52
53
There is no need to copy the files to remote hosts before creating the resource.
53
54
54
55
```terraform
@@ -81,7 +82,7 @@ resource "docker_image" "zoo" {
81
82
}
82
83
```
83
84
84
-
###Buildx
85
+
## Buildx
85
86
86
87
-> **Note**: The buildx feature is currently in preview and may have some quirks. Known issues: Setting `ulimits` will not work.
Copy file name to clipboardExpand all lines: docs/v3_v4_migration.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,10 @@
4
4
5
5
Bump of minimum terraform version to `1.1.5` or newer. This is done as part of introducing the new `terraform-plugin-framework` to develop this provider.
6
6
7
+
## `docker_image`
8
+
9
+
**Reworked handling of context and Dockerfile:** This probably is not a breaking change, but more a big bugfix. The build logic now correctly resolves the Dockerfile path for both relative and absolute cases.
// s.Spec.TaskTemplate.Placement.Preferences[0].Spread.SpreadDescriptor != "spread=node.role.manager" || Note: junkern: it's 0xc000c15100 in the log as of docker engine 29.1.5
536
536
// s.Spec.TaskTemplate.Placement.MaxReplicas == uint64(2) || NOTE: mavogel: it's 0x2 in the log but does not work here either
You can also use the resource to build an image. If you want to use a buildx builder with all of its features, please read the section below.
32
32
33
33
-> **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).
34
34
35
35
In this case the image "zoo"and"zoo:develop" are built.
36
-
The `context`and`dockerfile` arguments are relative to the local Terraform process (`path.cwd`).
36
+
The `context` path is resolved on the machine running Terraform (relative paths are relative to the current working directory, i.e.`path.cwd`).
37
+
If `dockerfile` is not an absolute path, it is resolved relative to `context`.
37
38
There is no need to copy the files to remote hosts before creating the resource.
0 commit comments