问题
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