Update existing container that is running

Vidar 21 Reputation points
2024-02-13T21:08:15.4833333+00:00

Hi, I am new to all this so bear with me. I have successfully deployed a Docker image (on my local machine in Visual Studio Code) to a Container Registry and from there deployed to a Container Instance (via Azure website). User's image

In my Container Instances I can see my running containers. I have tagged it with version 1.8. Back to my local PC (VS Code) I have made some changes to my code in the image and remade a container with tag 1.9. My question is - how do I update the already running 1.8 version with my 1.9 version? There seems no obvious, clean and easy way of doing this - other than deleting the container instance and deploying the new container version with a new container instance. Surely this can't be right!?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
670 questions
0 comments No comments
{count} votes

Accepted answer
  1. shiva patpi 13,161 Reputation points Microsoft Employee
    2024-02-13T23:16:49.38+00:00

    Hello Vidar,

    As per the document [https://video2.skills-academy.com/en-us/azure/container-instances/container-instances-update](https://video2.skills-academy.com/en-us/azure/container-instances/container-instances-update)
    

    you can use:

    az container create -g rgname --name containername --image acr.azurecr.io/image:newtag

    As per the document https://video2.skills-academy.com/en-us/azure/container-instances/container-instances-update#properties-that-require-container-delete

    Only certain (below) properties can't be updated!! i.e. if you want to update any of the below parameters , it needs to be re-created !

    • OS type
    • CPU, memory, or GPU resources
    • Restart policy
    • Network profile
    • Availability zone

    I just tested with above command and it works for updating the image version ! please try out

    Regards,

    Shiva.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Silvia Wibowo 3,411 Reputation points Microsoft Employee
    2024-02-13T23:31:28.3033333+00:00

    Hi @Vidar , I belive you have a running Azure Container Instance and you want to update it with a new image.

    You have options to deploy to Azure Container Instance:

    1. Deploy using Logic Apps connector
    2. Deploy with GitHub Actions

    whichever is easier for you.

    0 comments No comments