【发布时间】:2021-07-12 12:31:26
【问题描述】:
我正在将一个应用程序从一个容器和一个存储在 DockerHub 中的图像部署到 Azure。当我在 DockerHub 中部署存储库时,它是公开的,因此我可以轻松部署它。但是,我希望将存储库设为私有并且仍然能够部署它。我可以以某种方式将 DockerHub 的凭据传递给 terraform 配置吗?
目前这是我用来部署容器的方法。这一切都有效,但我真的很想将 repo 设为私有。
resource "azurerm_container_group" "cg" {
name = "mycontainer"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
ip_address_type = "public"
dns_name_label = "mycontainer"
os_type = "Linux"
container {
name = "mycontainer"
image = "myuser/myimage:tag"
cpu = "0.5"
memory = "1.5"
ports {
port = 80
protocol = "TCP"
}
}
}
【问题讨论】: