我有一个已经运行的docker容器.我做了一些配置更改,比方说在容器内的/ etc/hosts中添加了一些主机信息.如何保存更改,以便下次当我打开交互式shell到容器时,我不必再做同样的事情了?现在我已经在容器内创建了一个mini脚本,如下面的addhosts.sh,每次都要运行它.
echo "1.2.3.4 server1.example.com gluster1" >> /etc/hosts
echo "5.6.7.8 server2.example.com gluster2" >> /etc/hosts
Run Code Online (Sandbox Code Playgroud)
这是其中一个案例.同样,我需要所有配置都完好无损.请不要建议使用dockerfile,因为我没有创建图像,而是我刚刚进入容器.
我试图使用Terraform自动化应用程序网关的部署已经有些长时间了,但是它失败并显示一条错误消息。我确保所有协议设置都为HTTPS。但是,我怀疑PFX证书是否有些混乱。
是否由于失败而未提供身份验证证书?在网络上进行了大量尝试以获得解决方案,但是对此没有提及。
Terraform代码:
# Create a resource group
resource "azurerm_resource_group" "rg" {
name = "my-rg-application-gateway-12345"
location = "West US"
}
# Create a application gateway in the web_servers resource group
resource "azurerm_virtual_network" "vnet" {
name = "my-vnet-12345"
resource_group_name = "${azurerm_resource_group.rg.name}"
address_space = ["10.254.0.0/16"]
location = "${azurerm_resource_group.rg.location}"
}
resource "azurerm_subnet" "sub1" {
name = "my-subnet-1"
resource_group_name = "${azurerm_resource_group.rg.name}"
virtual_network_name = "${azurerm_virtual_network.vnet.name}"
address_prefix = "10.254.0.0/24"
}
resource "azurerm_subnet" "sub2" {
name = "my-subnet-2"
resource_group_name = "${azurerm_resource_group.rg.name}"
virtual_network_name = "${azurerm_virtual_network.vnet.name}"
address_prefix = "10.254.2.0/24" …
Run Code Online (Sandbox Code Playgroud) 长期以来,我一直在努力在 Azure VM 中运行自定义 shell 脚本。Shell 命令工作正常,但是当我将它们捆绑到 shell 脚本时,它失败了。我已经在 节中定义了 shell 脚本settings
。
地形代码:
resource "azurerm_resource_group" "test" {
name = "acctestrg"
location = "West US"
}
resource "azurerm_virtual_network" "test" {
name = "acctvn"
address_space = ["10.0.0.0/16"]
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
}
resource "azurerm_subnet" "test" {
name = "acctsub"
resource_group_name = "${azurerm_resource_group.test.name}"
virtual_network_name = "${azurerm_virtual_network.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "azurerm_public_ip" "pubip" {
name = "tom-pip"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
public_ip_address_allocation = "Dynamic"
idle_timeout_in_minutes = …
Run Code Online (Sandbox Code Playgroud)