Skip to content

Commit

Permalink
Merge pull request #395 from mbeacom/docker-build-platform
Browse files Browse the repository at this point in the history
feat: Expose platform argument to the docker-build module
  • Loading branch information
bryantbiggs authored Jan 10, 2023
2 parents 5481694 + 4708188 commit c13206f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/container-image/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ module "docker_image" {
build_args = {
FOO = "bar"
}
platform = "linux/amd64"
}

resource "random_pet" "this" {
Expand Down
1 change: 1 addition & 0 deletions modules/docker-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ No modules.
| <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 |
| <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 |
| <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 |
| <a name="input_platform"></a> [platform](#input\_platform) | The target architecture platform to build the image for. | `string` | `null` | no |
| <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 |
| <a name="input_source_path"></a> [source\_path](#input\_source\_path) | Path to folder containing application code | `string` | `null` | no |

Expand Down
1 change: 1 addition & 0 deletions modules/docker-build/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ resource "docker_registry_image" "this" {
context = var.source_path
dockerfile = var.docker_file_path
build_args = var.build_args
platform = var.platform
}

keep_remotely = var.keep_remotely
Expand Down
6 changes: 6 additions & 0 deletions modules/docker-build/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ variable "keep_remotely" {
type = bool
default = false
}

variable "platform" {
description = "The target architecture platform to build the image for."
type = string
default = null
}

0 comments on commit c13206f

Please sign in to comment.