Skip to content

Commit db34260

Browse files
fix: Added support for keep_remotely in docker-build submodule (#284)
Co-authored-by: Anton Babenko <[email protected]>
1 parent 5e5d560 commit db34260

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

modules/docker-build/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ module "docker_image" {
4444
|------|---------|
4545
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
4646
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.35 |
47-
| <a name="requirement_docker"></a> [docker](#requirement\_docker) | >= 2.8.0 |
47+
| <a name="requirement_docker"></a> [docker](#requirement\_docker) | >= 2.12 |
4848

4949
## Providers
5050

5151
| Name | Version |
5252
|------|---------|
5353
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.35 |
54-
| <a name="provider_docker"></a> [docker](#provider\_docker) | >= 2.8.0 |
54+
| <a name="provider_docker"></a> [docker](#provider\_docker) | >= 2.12 |
5555

5656
## Modules
5757

@@ -81,6 +81,7 @@ No modules.
8181
| <a name="input_ecr_repo_tags"></a> [ecr\_repo\_tags](#input\_ecr\_repo\_tags) | A map of tags to assign to ECR repository | `map(string)` | `{}` | no |
8282
| <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 |
8383
| <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 |
84+
| <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 |
8485
| <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 |
8586
| <a name="input_source_path"></a> [source\_path](#input\_source\_path) | Path to folder containing application code | `string` | `null` | no |
8687

modules/docker-build/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ resource "docker_registry_image" "this" {
2727
dockerfile = var.docker_file_path
2828
build_args = var.build_args
2929
}
30+
31+
keep_remotely = var.keep_remotely
3032
}
3133

3234
resource "aws_ecr_repository" "this" {

modules/docker-build/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ variable "ecr_repo_lifecycle_policy" {
6464
type = string
6565
default = null
6666
}
67+
68+
variable "keep_remotely" {
69+
description = "Whether to keep Docker image in the remote registry on destroy operation."
70+
type = bool
71+
default = false
72+
}

modules/docker-build/versions.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ terraform {
22
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 3.35"
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 3.35"
8+
}
69
docker = {
710
source = "kreuzwerker/docker"
8-
version = ">= 2.8.0"
11+
version = ">= 2.12"
912
}
1013
}
1114
}

0 commit comments

Comments
 (0)