I have an image in the repository on the docker hub. I created azure container instance based on the image in the repository on the docker hub. I updated the image in the repository on the docker hub. How can I apply changes to a container?
4 Answers
You can also use Azure CLI. Run az container create
again using the same resource group name and container group name, with the new image tag. The container will be updated with new image.

- 331
- 2
- 4
-
Also needed some more params for Windows type containers. See [doc'n](https://learn.microsoft.com/en-us/cli/azure/container?view=azure-cli-latest#az-container-create) – Peter L Aug 28 '19 at 20:57
-
2What if the tag name doesn't change, ie you're using a branch tag of master or `latest` – IronSean May 01 '20 at 20:47
-
5this does not seem work @anders. if the container exists, you get this error: "If you are going to update the os type, restart policy, network profile, CPU, memory or GPU resources for a container group, you must delete it first and then create a new one" – Mario Jacobo Jun 30 '20 at 15:10
If you follow the practice of naming tags :latest
then no need to re-create the Container
- Push the image
- Reset the Container Instance
- Done!
This is for image only update

- 11,445
- 4
- 37
- 47
-
How do you reset the image? The azure CLI has an `az container restart` command, but I'm not sure that does the same thing or pulls the latest version of the image. – IronSean May 01 '20 at 20:43
-
6Having just tested this, it does just require a restart. I have a container deployed which is referencing the `:latest` tag. Executing the `az container restart` command resulting in the image being pulled again and deployed. – AkkarinZA May 21 '20 at 09:12
-
1This does work. MS docs also states that az container restart will pull in the latest image from your azure container registry. https://learn.microsoft.com/en-us/cli/azure/container?view=azure-cli-latest#az-container-restart – Anubis77 Dec 21 '22 at 19:46
The ways I've found so far are
to use the Azure Resource explorer.
- Find the container group
- Click read/write
- Click edit
- Change the image version
- Put password in
imageRegistryCredentials
when using a private registry. - Click Post
This blog post using the Go SDK.
- Delete and recreate the group by using an ARM template. You'll loose the public ip using this approach.
You'll have some downtime in any of the cases above.

- 11,402
- 17
- 27
-
3
-
1@Taylor I think LoekD means the read/write button on the top nav bar. It's required before any values can be changed, otherwise an error requiring that mode will be shown. – J M Rossy Aug 03 '20 at 21:55
In addition to the mentioned re-creation of the container group and depending on your scenario you could also deploy a container group pointing to the :latest
docker image once.
In my scenario I have a scheduled container instance that is running once a day. Whenever it starts it is pulling the docker image with the :latest
tag from the azure container registry. This avoids re-creation of the container group.

- 348
- 3
- 11