-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add Azure Container Registry example
- Loading branch information
Showing
12 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/ignorefile.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM ubuntu:22.04 | ||
COPY src / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
provider "docker" { | ||
host = "unix:///var/run/docker.sock" | ||
registry_auth { | ||
address = azurerm_container_registry.acr.login_server | ||
username = azurerm_container_registry.acr.admin_username | ||
password = azurerm_container_registry.acr.admin_password | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
resource "random_password" "this" { | ||
length = 16 | ||
special = false | ||
} | ||
|
||
resource "azurerm_container_registry" "acr" { | ||
name = "${var.name}Registry${random_password.this.result}" | ||
resource_group_name = var.resource_group_name | ||
location = var.location | ||
sku = "Basic" | ||
admin_enabled = true | ||
} | ||
|
||
module "docker_image" { | ||
source = "../../" | ||
name = var.name | ||
registry = azurerm_container_registry.acr.login_server | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
variable "name" { | ||
description = "A unique name for your Image" | ||
type = string | ||
} | ||
|
||
variable "resource_group_name" { | ||
description = "Azure Resource Group to deploy platform. This Resource should be already created" | ||
type = string | ||
} | ||
|
||
variable "location" { | ||
description = "Region to deploy the resources" | ||
type = string | ||
default = "westeurope" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
terraform { | ||
required_version = ">= 1.0" | ||
|
||
required_providers { | ||
docker = { | ||
source = "kreuzwerker/docker" | ||
version = ">=3.0.0" | ||
} | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = ">=3.0.0" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = ">=3.0.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "image" { | ||
description = "Name of the created docker image" | ||
value = local.image_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters