Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the way to upate latest image in ACR

Several questions in this post. I’m using Azure Kubernetes service, and I have images in ACR.

When I use kubectl run my-pod --image my-acr/my-image, does it use the image with latest tag, eg, my-acr/my-image:latest.

When I push the image built locally, I do things like

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  1. Build my-image:v1
  2. Tag my-image:v1 with my-acr/my-image:latest
  3. Now, should I delete my-acr/my-image:latest from ACR first, then push it. Or I can directly do the push?

>Solution :

  1. Using the kubectl run command:
    –When you use the kubectl run command with the –image flag, it will use the image specified, including the tag. If you don’t specify a tag , it will default to using the latest tag.
    –For example, if you run kubectl run my-pod –image my-acr/my-image, it will use the image my-acr/my-image:latest. If you want to use a specific version/tag , you should specify it explicitly.
  2. Updating the image in ACR:
    –To update the image in ACR , you don’t necessarily need to delete the existing latest tag before pushing the updated image.
    –After building your image locally and tagging it with a specific version/tag (e.g., my-image:v1), you can directly push it to ACR with the desired tag (e.g. , my-acr/my-image:v1).
    –The latest tag in ACR will still point to the previous image unless you explicitly update it. You can choose to update the latest tag to point to the newly pushed image by using the az acr repository update command or by re-tagging the new image as my-acr/my-image:latest and pushing it again.

Here’s an example workflow to update the image in ACR:

  1. Build your image locally: docker build -t my-image:v1 .
  2. Tag the image with the ACR repository name and version: docker tag my-image:v1 my-acr/my-image:v1
  3. Push the image to ACR: docker push my-acr/my-image:v1
  4. If you want the latest tag to point to the newly pushed image , you can update it using the az acr repository update command or by re-tagging the image as my-acr/my-image:latest and pushing it again.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading