Skip to content

Conversation

@yashkukrecha
Copy link

This PR adds Docker-compatible --all-tags support and fixes a SOCI regression when pushing multiple tags of the same image.

Key changes:

  • New --all-tags flag for image push
  • SOCI integration fix for multi-tag pushes

Fixes #3751

Comment on lines +126 to +138
var tagRefs []string
for _, img := range imgList {
if strings.HasPrefix(img.Name, repo+":") {
tagRefs = append(tagRefs, img.Name)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prefix matching is too broad and can match unintended images. For example, if repository is mytest , it will correctly match mytest:latest. But it will also incorrectly match mytestrepo:latest

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If repo is mytest and img.Name is mytestrepo:latest, the strings would not match. The HasPrefix method would check if mytest: is a prefix of mytestrepo:latest, which is false.

if err != nil {
return err
// Handle --all-tags
if options.AllTags {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, iff user runs nerdctl push myrepo:v1 --all-tags , the tag :v1 is silently ignored. It should return an error like docker does: https://github.com/docker/cli/blob/1a1a4fc478fcd0131f3f3225b98faa5bd16dc51e/cli/command/image/push.go#L102

Signed-off-by: Yash Kukrecha <ykukrecha@gmail.com>
@yashkukrecha yashkukrecha force-pushed the support-push-all-tags branch from e4b16ed to 9a3cfc5 Compare December 8, 2025 18:10
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 this pull request may close these issues.

Support push --all-tags to push all tags

2 participants