acr icon indicating copy to clipboard operation
acr copied to clipboard

Trigger ACR Task by tag update

Open kuwe1990 opened this issue 4 years ago • 7 comments

I read the base image update trigger acr task in web page: https://docs.microsoft.com/en-us/azure/container-registry/container-registry-tasks-base-images

Stable tag for base image - To trigger a task on base image update, the base image must have a stable tag, such as node:9-alpine. This tagging is typical for a base image that is updated with OS and framework patches to a latest stable release. "If the base image is updated with a new version tag, it does not trigger a task". For more information about image tagging, see the best practices guidance.

Currently, my case is, I want to re-tag a layers to the same registry. Is there anyway I can trigger acrTask when the new tag get update.

kuwe1990 avatar Apr 15 '20 01:04 kuwe1990

@kuwe1990, can you elaborate a little bit "re-tag a layers to the same registry" and "trigger acrTask when the new tag get update"?

Assume you have a base image myimage:tag1 and you run a task to build the image using the Dockerfile like the following.

FROM myimage:tag1
RUN ...

Do you mean you want to trigger the task by pushing a new image myimage:tag2?

/cc: @SteveLas

northtyphoon avatar Apr 15 '20 06:04 northtyphoon

Hi Bin, For example, I push myimage to A:tag1. And there is a ACRTask1 listen to this tag(A:tag1). And it trigger properly. Then I push myimages to B:tag1. There is also a ACRTask2 listen to this tag(B:tag1), But the acrTask2 did not trigger properly. BestKui Sent from Mail for Windows 10 From: Bin DuSent: Tuesday, April 14, 2020 11:44 PMTo: Azure/acrCc: Kui Wen; MentionSubject: Re: [Azure/acr] Trigger ACR Task by tag update (#374) @kuwe1990, can you elaborate a little bit "re-tag a layers to the same registry" and "trigger acrTask when the new tag get update"?Assume you have a base image myimage:tag1 and you run a task to build the image using the Dockerfile like the following.FROM myimage:tag1RUN ...Do you mean you want to trigger the task by pushing a new image myimage:tag2?/cc: @SteveLas—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe. 

kuwe1990 avatar Apr 16 '20 00:04 kuwe1990

I push myimage to A:tag1. And there is a ACRTask1 listen to this tag(A:tag1). And it trigger properly. Then I push myimages to B:tag1. There is also a ACRTask2 listen to this tag(B:tag1), But the acrTask2 did not trigger properly.

@kuwe1990 can you share your registryname and taskname? You can send them to [email protected]

BTW: It's very difficult to read your reply as the format is messed up. Are you able to use the github website to reply?

northtyphoon avatar Apr 16 '20 00:04 northtyphoon

Sure,Registry:OnePubTestAcrDev. There is not task trigger properly. I can provide tag public/windows/servercore:1903

kuwe1990 avatar Apr 16 '20 00:04 kuwe1990

Any update for this issue?

kuwe1990 avatar May 01 '20 22:05 kuwe1990

I guess it is a bit hard for us to understand the scenario being requested here. Could you explain with an example of what you want triggered with sample tags?

sajayantony avatar May 07 '20 00:05 sajayantony

for example, in registry OnePubAcrProd, I have task internal1903Server, this task monitor internal/private/windows/servercore:1903-amd64. I have another task public1903Server, monitor public/windows/servercore:1903-amd64.We first publish to internal/private/windows/servercore:1903-amd64. it will trigger internal1903Server. But when we update public/windows/servercore:1903-amd64 with the images already exist in internal/private/windows/servercore:1903-amd64 .public1903Server not trigger properly

kuwe1990 avatar May 10 '20 22:05 kuwe1990