How can I pass container level arguments in azure container create

╄→尐↘猪︶ㄣ 提交于 2020-04-18 05:46:17

问题


When I run docker locally "docker run -it -p 8080:8080 codercom/code-server --auth none" I am using --auth none argument, but how can i use this in azure container create commands.

If I run normally like "az container create --resource-group learn-deploy-vsCode --name code-server --image codercom/code-server --auth none --ports 8080 --dns-name-label san-codeserver --location eastus" it is throwing error "az: error: unrecognized arguments: --auth none".


回答1:


When you run the command docker run -it -p 8080:8080 codercom/code-server --auth none locally, it means you add the parameter --auth none for the command in the link you provide. But when you run the CLI command with the parameter --auth none, the Azure CLI will look it as the parameter of the CLI command az container create, and this parameter does not support in the CLI.

So what you need to do is change the CLI command like this:

az container create --resource-group learn-deploy-vsCode \
--name code-server \
--image codercom/code-server \
--command-line "/usr/local/bin/code-server --host 0.0.0.0 . --auth none" \
--ports 8080 \
--dns-name-label san-codeserver   \
--location eastus


来源:https://stackoverflow.com/questions/61093103/how-can-i-pass-container-level-arguments-in-azure-container-create

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!