Is there a way to execute a command in a container hosted in ACI? I'm looking for something like this:
docker container exec [image] [command]
Is there a way to execute a command in a container hosted in ACI? I'm looking for something like this:
docker container exec [image] [command]
You can use the Azure CLI tools, with a command like:
az container exec -g container-group --name container-name --exec-command "/bin/bash"
For more information, see this document: https://learn.microsoft.com/en-us/azure/container-instances/container-instances-exec
However, I've noticed that I currently cannot select the user to run the command as (such as docker exec -u "user").
az container exec --resource-group myResourceGroup --name <name of cotainer group> --container-name <name of container app> --exec-command "/bin/bash"
Not yet, but it's on our list. For the moment, the best you can do is SSHing into the container and running your command that way.