容器运行后在Azure容器实例中运行命令 [英] Running commands in azure container instance after container running

查看:87
本文介绍了容器运行后在Azure容器实例中运行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行代码服务器容器,并且正在运行 az容器exec --resource-group资源名称--name代码服务器--exec命令 ls 它给出了文件和文件夹列表,但是如果我们运行 az容器exec --resource-group resourcename --name代码服务器--exec-command cd文件夹 无法正常工作,显示错误,例如 rpc错误:代码= 2 desc = oci运行时错误:exec失败:container_linux.go:247:启动容器进程引起 exec:\ cd Angular\:可执行文件在$ PATH中找不到

I am having code-server container running and I am running az container exec --resource-group resourcename --name code-server --exec-command "ls" it is giving list of files and folder but if we run az container exec --resource-group resourcename --name code-server --exec-command "cd folder" not working showing error like rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"cd Angular\": executable file not found in $PATH"

推荐答案

当您要在其中执行命令时,这是一个常见问题容器实例。此功能并非绝对支持Azure容器实例。它仅支持单个命令,并且在此处显示

It's a common issue when you want to execute the commands inside the container instance. This feature does not absolutely support on Azure Container Instance. It only supports the single command and it shows here:


Azure容器实例当前支持使用az容器exec启动单个
进程,并且您无法传递命令论点。
例如,您不能链接sh -c中的命令 echo FOO&& echo
BAR,或执行echo FOO。

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.

这篇关于容器运行后在Azure容器实例中运行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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