Skip to content

Commit c13206f

Browse files
authored
Merge pull request #395 from mbeacom/docker-build-platform
feat: Expose platform argument to the docker-build module
2 parents 5481694 + 4708188 commit c13206f

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

examples/container-image/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module "docker_image" {
6666
build_args = {
6767
FOO = "bar"
6868
}
69+
platform = "linux/amd64"
6970
}
7071

7172
resource "random_pet" "this" {

modules/docker-build/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ No modules.
9595
| <a name="input_image_tag"></a> [image\_tag](#input\_image\_tag) | Image tag to use. If not specified current timestamp in format 'YYYYMMDDhhmmss' will be used. This can lead to unnecessary rebuilds. | `string` | `null` | no |
9696
| <a name="input_image_tag_mutability"></a> [image\_tag\_mutability](#input\_image\_tag\_mutability) | The tag mutability setting for the repository. Must be one of: `MUTABLE` or `IMMUTABLE` | `string` | `"MUTABLE"` | no |
9797
| <a name="input_keep_remotely"></a> [keep\_remotely](#input\_keep\_remotely) | Whether to keep Docker image in the remote registry on destroy operation. | `bool` | `false` | no |
98+
| <a name="input_platform"></a> [platform](#input\_platform) | The target architecture platform to build the image for. | `string` | `null` | no |
9899
| <a name="input_scan_on_push"></a> [scan\_on\_push](#input\_scan\_on\_push) | Indicates whether images are scanned after being pushed to the repository | `bool` | `false` | no |
99100
| <a name="input_source_path"></a> [source\_path](#input\_source\_path) | Path to folder containing application code | `string` | `null` | no |
100101

modules/docker-build/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ resource "docker_registry_image" "this" {
1616
context = var.source_path
1717
dockerfile = var.docker_file_path
1818
build_args = var.build_args
19+
platform = var.platform
1920
}
2021

2122
keep_remotely = var.keep_remotely

modules/docker-build/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,9 @@ variable "keep_remotely" {
7676
type = bool
7777
default = false
7878
}
79+
80+
variable "platform" {
81+
description = "The target architecture platform to build the image for."
82+
type = string
83+
default = null
84+
}

0 commit comments

Comments
 (0)