0

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"

2
  • what base image are you using ? some base image don't come with all of the basic linux commands. Commented Apr 29, 2020 at 17:11
  • @djsly Its codercom/code-server which has ubuntu 18.04 Commented Apr 30, 2020 at 3:04

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

any other solution so I can run some git commands while running
@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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.