For repos like https://github.com/dotnet/dotnet-buildtools-prereqs-docker where the tags contain dynamically generated values like a timestamp, there's an issue when applied to cache images. If the image gets a cache hit and is pulled from the registry, it ends up getting tagged with the new dynamically generated tag rather than its original tag. This new tag gets pushed as well.
An example:
The Dockerfile in https://github.com/dotnet/dotnet-buildtools-prereqs-docker with path src/ubuntu/22.04/cross/arm-alpine gets built. The tag of the previously published image is ubuntu-22.04-cross-arm-alpine-20221207144316-3fc5553. During the build, it detects a cache hit and pulls it from the registry. As part of loading the manifest, it dynamically generates a new tag value of ubuntu-22.04-cross-arm-alpine-20230106221608-3fc5553 and tags the image with that and pushes that tag. Now the image is tagged with both of those tags.
This is not good because a new tag implies a new image but it's actually just a new tag on the original cached image.
For repos like https://github.com/dotnet/dotnet-buildtools-prereqs-docker where the tags contain dynamically generated values like a timestamp, there's an issue when applied to cache images. If the image gets a cache hit and is pulled from the registry, it ends up getting tagged with the new dynamically generated tag rather than its original tag. This new tag gets pushed as well.
An example: The Dockerfile in https://github.com/dotnet/dotnet-buildtools-prereqs-docker with path
src/ubuntu/22.04/cross/arm-alpine
gets built. The tag of the previously published image isubuntu-22.04-cross-arm-alpine-20221207144316-3fc5553
. During the build, it detects a cache hit and pulls it from the registry. As part of loading the manifest, it dynamically generates a new tag value ofubuntu-22.04-cross-arm-alpine-20230106221608-3fc5553
and tags the image with that and pushes that tag. Now the image is tagged with both of those tags.This is not good because a new tag implies a new image but it's actually just a new tag on the original cached image.
The pending changes in https://github.com/dotnet/docker-tools/pull/1091 do not fix this issue either.