如何在Azure容器创建中传递容器级别的参数 [英] How can I pass container level arguments in azure container create

查看:107
本文介绍了如何在Azure容器创建中传递容器级别的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在本地运行docker docker run -it -p 8080:8080 codercom / code-server --auth none 我正在使用--auth none参数时,但是我如何在azure容器中使用它来创建命令。

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.

如果我像 az容器那样正常运行,请创建--resource-group learning-deploy -vsCode-名称代码服务器-图像编解码器/代码服务器--auth none-端口8080 --dns-name-label san-codeserver --location eastus它抛出错误 az:错误:无法识别的参数:--auth none

推荐答案

运行命令 docker run -it -p 8080:8080 codercom / code-server --auth none 在本地,这意味着您添加参数-auth none 您提供的链接中的命令。但是,当使用参数-auth none 运行CLI命令时,Azure CLI会将其视为CLI命令 az容器创建 ,并且CLI中不支持此参数。

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.

因此,您需要做的是如下更改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

这篇关于如何在Azure容器创建中传递容器级别的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆