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

Tags delimited by colon, not @ ? #861

Closed
adibsaad opened this issue Feb 21, 2021 · 5 comments
Closed

Tags delimited by colon, not @ ? #861

adibsaad opened this issue Feb 21, 2021 · 5 comments

Comments

@adibsaad
Copy link

Hi,

In this line

if opts.Tag == "" && strings.Contains(opts.Repository, "@") {
I noticed you are extracting the tag by splitting on the @ character, but aren't tags separated by : e.g. ubuntu:latest or am I missing something here?

I found this issue when I was debugging another issue related to moby/moby#42053

Thanks.

@fsouza
Copy link
Owner

fsouza commented Feb 21, 2021

Hi @adibsaad, tags are delimited by :, and digests are delimited by @. The Docker API overloads the "tag" parameter with both the tag and the digest: https://docs.docker.com/engine/api/v1.41/#operation/ImageCreate

@thaJeztah
Copy link

thaJeztah commented Feb 24, 2021

Perhaps it would make sense to add an PullImageOptions.All option (similar to api/types/client.go#L252-L254; the All option would skip sending the tag parameter.

go-dockerclient/image.go

Lines 293 to 296 in 91f5ca9

type PullImageOptions struct {
Repository string `qs:"fromImage"`
Tag string
Platform string `ver:"1.32"`

client.PullImage() could produce an error if neither the All option, nor Tag are set;

func (c *Client) PullImage(opts PullImageOptions, auth AuthConfiguration) error {

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jun 2, 2021
@fsouza fsouza closed this as completed in 580a8bc Jun 3, 2021
@adibsaad
Copy link
Author

adibsaad commented Jun 3, 2021

Thanks @fsouza , I'd forgotten about this.

@fsouza
Copy link
Owner

fsouza commented Jun 3, 2021

@adibsaad me too lol Thank the bot haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants