Server - VSTS
Agent - Hosted:
Could be related to #8031 ?
Over the last two days, it seems that includeLatestTag: true has silently stopped being respected in our docker push task because we no longer get the :latest container tag updated.
Checking the logs, it is clear that our builds no longer push to :latest and only push to :$(Build.BuildId) based on our configuration
No errors are shown
our task looks like this
- task: Docker@1
displayName: "Push to the test ACR"
inputs:
azureSubscriptionEndpoint: xxx
azureContainerRegistry: xxx
command: "Push an image"
imageName: "xxx/xxx:$(Build.BuildId)"
includeLatestTag: true
@billytrend , We have removed "includeLatestTag" input from "Push an image" command to keep task consistency with 'docker push' command behavior. You can add another task to push latest tag image "xxx/xxx:latest" or you can change input from "xxx/xxx:$(Build.BuildId)" to "xxx/xxx" (image with no tag). If you specify image with no tag, docker push all versions/tags of image to repository.
Thanks for getting back to me. It would have been useful to provide communication or to fail builds that include includeLatestTag: true since we lost some time to people dev'ing against the out of date :latest containers
@billytrend , Sorry for inconvenience caused to you. We are updating the docs.
@vithati The tooltip on the "Include latest tag" checkbox for the "Build an image" command needs to be changed too. It shows:
Include the 'latest' tag when building or pushing the Docker image.
Fixed tooltip in the PR https://github.com/Microsoft/vsts-tasks/pull/8482.
or you can change input from "xxx/xxx:$(Build.BuildId)" to "xxx/xxx" (image with no tag). If you specify image with no tag, docker push all versions/tags of image to repository.
This task builds the Docker image and creates 2 tags $BuildId and latest:
````
Trying to push both tags without a version information:
````
This pushes only the image, tagged with the $BuildId :(
You can add another task to push latest tag image "xxx/xxx:latest"
When I try to follow this advice with the following tasks:
````
The first push succeeds, but for the second I get an error like this:
The issue seems to be lower and upper-case issue. The docker build step reports the 2 tags to be created:
2019-01-11T13:04:37.2765515Z Successfully tagged myContainerRegistry.azurecr.io/start.spring.io:133
2019-01-11T13:04:37.2959758Z Successfully tagged mycontainerregistry.azurecr.io/start.spring.io:latest
The workaround is this:
````
That means I run the build and the push 2 times, once for each tag I want to get pushed to the ACR.
@mrumpf , You don't need to add duplicate tasks, change ACR name to lowercase 'myContainerRegistry.azurecr.io' to 'mycontainerregistry.azurecr.io' like below. It will work. I have opened https://github.com/Microsoft/azure-pipelines-tasks/issues/9369 to track container registry lower and upper-case name issue.
Closing this issue. Please re-open issue if above workaround not working.
@vithati I followed your above suggestion -- however, the Push only pushed 'Latest' tag, not the versioned image.
Hi I am using below tasks in my azure pipeline and I am getting build no and latest tag.
- task: DockerCompose@0
inputs:
containerregistrytype: 'Azure Container Registry'
azureSubscription: $(azureSubscription)
azureContainerRegistry: $(azureContainerRegistry)
dockerComposeFile: $(dockerComposefilePath)
action: 'Build services'
additionalImageTags: 'Build.BuildId'
- task: DockerCompose@0
inputs:
containerregistrytype: 'Azure Container Registry'
azureSubscription: $(azureSubscription)
azureContainerRegistry: $(azureContainerRegistry)
dockerComposeFile: $(dockerComposefilePath)
action: 'Push services'
Most helpful comment
Thanks for getting back to me. It would have been useful to provide communication or to fail builds that include
includeLatestTag: truesince we lost some time to people dev'ing against the out of date :latest containers