【发布时间】:2021-05-06 02:30:28
【问题描述】:
我正在尝试使用 Azure 门户从 Azure 容器实例中的私有存储库部署基于 Windows 的容器,但我不确定我是否在“高级”部分正确(可能我没有)。问题是我必须在运行时传递一个参数,该参数设置许可证服务器的值,以便需要与许可证服务器建立连接的特定应用程序可以启动。 通常,容器的运行命令如下所示:
docker run IMAGE:TAG -LicenseServer Port@Host
我在 Dockerfile 中的入口点是一个 Powershell 脚本“Start.ps1”,它请求所提到的许可证服务器的相应值。
我已经阅读了manual,因此我插入了以下字符串来覆盖并传递参数:
[ "cmd", "Start.ps1", "-LicenseServer", "<Port>@<Hostname>"]
部署 ACI 后,Container 会进入“运行”状态几秒钟,然后再次终止。根据日志,它无论如何都没有工作。
所以我想知道,部署容器以使其运行的正确方法是什么?
非常感谢您!
除了我的问题,要获得更多上下文: ACI 是在 Azure 门户中创建的:
我使用了以下设置,请参阅 JSON 视图:
{
"properties": {
"sku": "Standard",
"provisioningState": "Succeeded",
"containers": [
{
"name": "<name>",
"properties": {
"image": "<image name>",
"command": [
"powershell",
"Start.ps1",
"-LicenseServer",
"<port>@<host>"
],
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"environmentVariables": [],
"instanceView": {
"restartCount": 1,
"currentState": {
"state": "Terminated",
"finishTime": "2021-04-28T06:06:22.2263538Z",
"detailStatus": "Container stopped per client request"
},
"previousState": {
"state": "Waiting",
"detailStatus": "CrashLoopBackOff: Back-off restarting failed"
}
},
"resources": {
"requests": {
"memoryInGB": 8,
"cpu": 1
}
}
}
}
],
"initContainers": [],
"imageRegistryCredentials": [
{
"server": "<login server>",
"username": "<user>"
}
],
"restartPolicy": "OnFailure",
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"type": "Public",
"dnsNameLabel": "mycontainerdns",
"fqdn": "mycontainerdns.westeurope.azurecontainer.io"
},
"osType": "Windows",
"instanceView": {
"events": [],
"state": "Stopped"
}
},
"id": "/subscriptions/<subscription id>",
"name": "<aci name>",
"type": "Microsoft.ContainerInstance/containerGroups",
"location": "westeurope",
"tags": {}
}
【问题讨论】:
标签: azure docker docker-for-windows azureportal azure-container-instances