使用命令行参数启动时 Azure ACI 容器部署失败

Azure ACI container deployment fails when launching with Command line arguments

我正在尝试从 Azure CLI 启动 ACI 容器。当我从命令行发送多个命令时部署失败,当我只传递一个命令时部署成功,例如 'ls'.

我是否以错误的方式向命令行传递了多个参数?

az container create --resource-group rg-***-Prod-Whse-Containers --name test--image alpine:3.5 --command-line "apt-get update   &&  apt-get install -y && wget wget https://www.google.com" --restart-policy never --vnet vnet-**-eastus2 --subnet **-ACI

不幸的是,您似乎不能运行一次执行多个命令。请参阅 ACI 的 exec 命令的 Restrictions

Azure Container Instances currently supports launching a single process with az container exec, and you cannot pass command arguments. For example, you cannot chain commands like in sh -c "echo FOO && echo BAR", or execute echo FOO.

您可以在CLI命令中执行whoamils等命令。

我建议你可以运行创建与容器实例的交互会话的命令,以便在你创建ACI后连续执行命令,参考这个类似