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"
Asked
Active
Viewed 960 times
0

San
- 69
- 1
- 8
-
what base image are you using ? some base image don't come with all of the basic linux commands. – djsly Apr 29 '20 at 17:11
-
@djsly Its codercom/code-server which has ubuntu 18.04 – San Apr 30 '20 at 03:04
1 Answers
1
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 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.

Charles Xu
- 29,862
- 2
- 22
- 39
-
-
@San Yeah, you can connect to the instance first with the command `az container exec -g group_name -n container_name --exec-command "/bin/bash"`, then you can execute the git command inside the instance. – Charles Xu Apr 30 '20 at 03:09