Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple tags for the same image don't get pushed properly #1815

Closed
shin- opened this issue Sep 6, 2013 · 1 comment · Fixed by #1833
Closed

Multiple tags for the same image don't get pushed properly #1815

shin- opened this issue Sep 6, 2013 · 1 comment · Fixed by #1833
Milestone

Comments

@shin-
Copy link
Contributor

shin- commented Sep 6, 2013

From the docker-user mailing list:

I've been playing with a simple private repo setup, running samalba's registry container and I'm pushing images to my repo as follows

docker tag b42c1 dockerhub.mydomain.net:5000/somerepo 001
docker push dockerhub.mydomain.net:5000/somerepo

this all works fine, I can see the tag in the repo.

My issue is that I'd like to add another tag for the same id e.g. to mark that the container has passed a stage of the delivery pipeline

docker tag b42c1 dockerhub.mydomain.net:5000/somerepo release
docker push dockerhub.mydomain.net:5000/somerepo

The repository shows up fine in my images list, but when I push it I get the following messages for each of the contained images

Image 27ae1b61fcf0888ff7ac500e07ecd5222bb3aab8c11ebc7005c2bd14ebd57ebb already pushed, skipping
Image 61b94d230f6189174b46b23c4c0ddd834911809b93952a7e8d694fc1453582a6 already pushed, skipping
Image d126d1284eeba943be24bd31794be7d10899c50dd9731cc71da0b30adc31b62f already pushed, skipping
Image 527a603aefde56422bd1e9eca48a84249232f0f6a11a22a6671205421e7a3f5c already pushed, skipping
Image b42c1d10865c26d1a6ee438688b2400b143c14fe6cd37c2acfb91a136098340f already pushed, skipping

Which is fair enough, but the new name is not pushed to the registry and tagged with the given name. I'm not sure if this is an issue with docker or the registry.

the same is true if i change the name slightly to not include the tag
docker tag b42c1 dockerhub.mydomain.net:5000/somerepo-release

Happens because of this snippet of code in server.go where continue happens before the PushRegistryTag method can be called:

for _, elem := range round {
    if _, exists := repoData.ImgList[elem.ID]; exists {
        out.Write(sf.FormatStatus("", "Image %s already pushed, skipping", elem.ID))
        continue
    } else if r.LookupRemoteImage(elem.ID, ep, repoData.Tokens) {
        out.Write(sf.FormatStatus("", "Image %s already pushed, skipping", elem.ID))
        continue
    }
    if checksum, err := srv.pushImage(r, out, remoteName, elem.ID, ep, repoData.Tokens, sf); err != nil {
        // FIXME: Continue on error?
        return err
    } else {
        elem.Checksum = checksum
    }
    out.Write(sf.FormatStatus("", "Pushing tags for rev [%s] on {%s}", elem.ID, ep+"repositories/"+remoteName+"/tags/"+elem.Tag))
    if err := r.PushRegistryTag(remoteName, elem.ID, elem.Tag, ep, repoData.Tokens); err != nil {
        return err
    }
}
@tianon
Copy link
Member

tianon commented Sep 14, 2013

There's nothing that makes the latest tag special or immune to the fix merged in #1833, is there? I've been having this issue for a little while, found this ticket while coming on to post a ticket, updated to master, and found that it works, but is still skipping my "latest" tags for some reason.

@shin- shin- removed their assignment Jul 24, 2014
trebonian pushed a commit to trebonian/docker that referenced this issue Jun 3, 2021
Flavio as Libnetwork maintainer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants