4

I am new to docker and I am trying to update an existing web service on an azure website. After building the image, this is what I did:

docker login <regname>.azurecr.io  # Successfully logged in
docker tag <myimage> <regname>.azurecr.io/<servicename>
docker push <regname>.azurecr.io/<servicename>

And this is what I get:

C:\Users\user> docker push <regname>.azurecr.io/<servicename>
The push refers to repository [<regname>.azurecr.io/<servicename>]
8338876046a2: Preparing
9b4cb369a379: Preparing
769a276cd781: Preparing
486305c59459: Preparing
c36e2873b733: Preparing
130ae36f8cc8: Preparing
bc6b4902b79e: Preparing
f3d44e887388: Preparing
4a39ef7ed1bb: Preparing
4c5aab3548b9: Preparing
ec348085b0e6: Preparing
c2be8853e0b2: Preparing
0f1151f5fc99: Preparing
00399b079947: Preparing
c82d454eb914: Preparing
b25487d1db04: Preparing
e367fb455ccf: Preparing
bc6b4902b79e: Pushed
57df5852e66c: Layer already exists
d788ea03fce1: Layer already exists
1ffa9e6f04f1: Layer already exists
377e5b96eca6: Layer already exists
90dd0108373f: Layer already exists
eb8fe74986a4: Layer already exists
e2a005b711f9: Layer already exists
3a29b9e0627a: Layer already exists
ca4c28881d11: Layer already exists
33614d3265ba: Layer already exists
270f4d759cc3: Layer already exists
0fa80309f3d6: Layer already exists
4e1d0b4d1868: Layer already exists
910d7fd9e23e: Pushed
4230ff7f2288: Pushed
2c719774c1e1: Layer already exists
ec62f19bb3aa: Layer already exists
f94641f1fe1f: Layer already exists
latest: digest: 
sha256:5d2729ae576349b158acc6c480acdde3899e2c6a9445966bb7e8d291677e11dd size: 7866

Note: The 'Layer already exists' is from a previous push I did. I had to do the push 2 times because for some layers it kept retrying and then reached EOF and stopped. So in the first push I pushed most of the layers, then in the second push the rest of the layers that could not be pushed the first time. Could the problem lie here?

The new image I want to push is completely different from the old one (they are both Flask apps).

After the above, I went to azure portal and restarted the service for this resource but nothing happened. The azure service remains the same and the new functionality hasn't been added.

I've read other posts that suggest that the problem lies on the tag names. I can't find a way around this since I want to update the existing image in the azure registry (does that mean that the tag names would be the same?).

Has anyone else encountered this problem or maybe has an idea about what I am doing wrong?

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
geoph9
  • 357
  • 3
  • 18
  • 1
    you shouldn't update the same image (tags would be the same, that's correct). it doesn't make any sense to do that – 4c74356b41 Jun 28 '19 at 08:28
  • Then how can I update the azure web service? Should I use `docker tag .azurecr.io/:v2` for example, in order to specify the new version? – geoph9 Jun 28 '19 at 08:53
  • tag the image and then push it with the tag - `docker push .azurecr.io/:` – Efrat Levitan Jun 28 '19 at 08:56
  • Okay, I have created another tag and pushed it. I can see the new tag in the Azure Portal but how do I activate it? I need to be able to send POST requests to the same URL but with the new image tag. – geoph9 Jun 28 '19 at 09:00
  • Maybe you miss set the Webhook for your Web app. Take a look at [View the updated web app](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-tutorial-deploy-update#view-the-updated-web-app). – Charles Xu Jun 28 '19 at 09:18
  • Thank you all. It turns out it was a rookie mistake. Just as @4c74356b41 and @Efrat Levitan said, the images should not be named exactly the same and so i used `docker tag .azurecr.io/:v2` and then pushed this v2 image. – geoph9 Jun 28 '19 at 12:01

1 Answers1

1

For your issue, you just need something to notify the Web App to update it. Then you need to create a Webhook for your Web App before updating your image. The description here in the next steps. For more details, see Push an updated container image to a geo-replicated container registry for regional web app deployments.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • Thank you for your answer. I have seen this tutorial and it did not help. Turns out that I should not have used `:latest` when tagging the image for the updated version (since `:latest` was taken from the image that was already uploaded). I used `.azurecr.io/:v2` and it worked just fine. This was a rookie mistake from my part. I will upvote your answer because it may help other people that struggled with this. – geoph9 Jun 28 '19 at 11:59
  • @geoph9 Why not, it's a setting for continuous deployment. And if you rebuild the image with the same name and tag, and the push action will trigger the webhook to update the web app with your rebuild image. – Charles Xu Jul 01 '19 at 07:34