1

I have created a clamav container instance (mkodockx/docker-clamav:alpine) within Azure but every few days it tends to be recreated by itself pulling the image over and over again, as you can see in the screengrab.

enter image description here

Is something wrong? Why would it be doing this?

I also have an Azure App Service which makes calls to the container instance over port 3310 but every few days it can't reach it... enter image description here

What is going on? Why can't it be reached? I reached out to Azure support but they were super unhelpful

I'm no expert in containerization so please dumb it down for me :)

Thanks

Andrew Duffy
  • 795
  • 2
  • 17
  • 37
  • Do you check if there is any task restart the container? Or anything wrong and cause the container restart. – Charles Xu Nov 04 '20 at 07:51
  • Cheers @CharlesXu where would I check for a task that restarts the container... also how can I check if there is anything wrong that is causing the container to restart? It's all very black box to me – Andrew Duffy Nov 04 '20 at 20:40

1 Answers1

0

I would start with setting the Restart Policy of the Azure Container Groups

There are three policies for the Azure Container Groups :

  1. Never
  2. Always
  3. On Failure

The default policy is Always

You could change the Policy and observe the output in your case :

You could use the below commandlet to change the Restart Policy :

az container create \
    --resource-group <myResourceGroup> \
    --name <mycontainer> \
    --image <IMAGE> \
    --restart-policy OnFailure #(or Never)

Reference

Satya V
  • 3,811
  • 1
  • 6
  • 9