Deploy ubuntu container in to Azure Container Instance and keep it running
It’s a common problem that the docker image
ubuntu is going to “Terminated” state and hard to keep it running. We can keep it running through a simple bash script running.
While you create the Container Instance, you need to add the command in the command line to make the container instance in the running state. For example, add the command
tail -f /dev/null as follows
The string should be added as [“tail”,”-f”,”/dev/null”]
This tricky method just keeps the container in the running state always and does not output anything and no logs output too.
You may access the container instance in bash as follows
az container exec –resource-group <Your resource group> –name <name of the container> –exec-command “/bin/bash”
Hope this help you to maintain your ubuntu in running state always 🙂