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?
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.
If you follow the practice of naming tags :latest
then there's no need to re-create the Container
- Push the image
- Reset the Container Instance
- Done!
This is for image only update
az container restart
command, but I'm not sure that does the same thing or pulls the latest version of the image. –
Wist :latest
tag. Executing the az container restart
command resulting in the image being pulled again and deployed. –
Yetah :latest
–
Zimmer 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.
latest
–
Wist az container export --file
. And then use the file to recreate. But secrets are stripped from the export. You can add them manually using yq
or something similar –
Zimmer 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.
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.
© 2022 - 2024 — McMap. All rights reserved.