Skip to content

Conversation

@umohnani8
Copy link
Member

skopeo copy, delete, and inspect can now use credentials stored in the auth file
by the kpod login command
e.g kpod login docker.io -> skopeo copy dir:mydir docker://username/image

Signed-off-by: Urvashi Mohnani umohnani@redhat.com

@umohnani8
Copy link
Member Author

@rhatdan @TomSweeneyRedHat @mtrmac PTAL

@umohnani8
Copy link
Member Author

@mtrmac would you prefer the authfile flag be flagPrefix+"authfile" as well?

docs/skopeo.1.md Outdated

**docker://**_docker-reference_
An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in `$HOME/.docker/config.json`, which is set e.g. using `(docker login)`.
An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in `$XDG_RUNTIME_DIR/containers/auth.json`, which is set e.g. using `(kpod login)`.
Copy link
Member

Choose a reason for hiding this comment

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

I think we should leave in that this works with either kpod login or docker login. Since skopeo is used by the larger docker community.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

docs/skopeo.1.md Outdated
```

# SEE ALSO
kpod-login(1)
Copy link
Member

Choose a reason for hiding this comment

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

Also add docker-login(1)

Copy link
Member

Choose a reason for hiding this comment

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

Should we not this in the Buildah/kpod commands too? I'm torn, we do use docker-login for those too, just don't want people to think we didn't think about that if we don't document it. Then again I'd rather not add a docker dependency to them. i.e. if docker changes auth at some point, then we'd have to adjust those for that rather than just dropping it.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.
@rhatdan should this be mentioned in buildah and kpod as well?

Copy link
Member

Choose a reason for hiding this comment

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

We can mention in buildah and kpod that docker login works, but don't need to specify it directly. Since those tools are not as tied into the Docker infrastructure as skopeo is.


Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json
which is set using `kpod login`

Copy link
Member

Choose a reason for hiding this comment

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

Just double checking as I've not tried. If you use the $HOME/.docker/config.json file as the auth file, is docker happy afterwards? I.e. if you do 'kpod login --auth ~/.docker/config.json', can you then run a docker command that requires auth without it spitting up? Really is not related to this review though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually haven't tried that yet. It might not work because there is a slight difference in the way kpod and docker store the registry name in auth.json and config.json.

Copy link
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

ACK overall, just one nit.

docs/skopeo.1.md Outdated
**--authfile** _path_

Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json
which is set using `kpod login` or `docker login`
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to say docker login writes to auth.json, which is not true. (Also in two other instances.)

Copy link
Member

Choose a reason for hiding this comment

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

If we have this in kpod and/or Buildah, can we touch it up there too please?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.
@TomSweeneyRedHat there is no mention of docker login in buildah or kpod. Is it something we want to add?

@mtrmac
Copy link
Contributor

mtrmac commented Nov 21, 2017

@mtrmac would you prefer the authfile flag be flagPrefix+"authfile" as well?

No, a single flag as you have implemented is better. The authFile can already carry configurations for multiple registries, so it doesn’t seem useful to support having a different one for sources and destinations.

@umohnani8
Copy link
Member Author

@mtrmac @runcom PTAL

@mtrmac
Copy link
Contributor

mtrmac commented Nov 21, 2017

LGTM

1 similar comment
@runcom
Copy link
Member

runcom commented Nov 21, 2017

LGTM

@rhatdan
Copy link
Member

rhatdan commented Nov 21, 2017

@umohnani8 Lets add something to kpod and buildah that mentions docker login.

docs/skopeo.1.md Outdated

**docker://**_docker-reference_
An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in `$HOME/.docker/config.json`, which is set e.g. using `(docker login)`.
An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in either `$XDG_RUNTIME_DIR/containers/auth.json`, which is set using `(kpod login)` or in `$HOME/.docker/config.json`, which is set using `(docker login)`
Copy link
Member

Choose a reason for hiding this comment

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

👍
@umohnani8 I do think this should probably be added to kpod/buildah somewhere. We're currently searching thorough containers/auth.json and then .docker/config.json in both of those now right? If not, then this should be added when we are.

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat Nov 21, 2017

Choose a reason for hiding this comment

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

I think we probably ought to note precedence here too. Perhaps: "By default, uses the authorization state in $XDG_RUNTIME_DIR/containers/auth.json, which is set using (kpod login). If the authorization state is not found there, then $HOME/.docker/config.jsonis checked which is set using(docker login)`."

FWIW, missing a period at the end of your current line here.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

docs/skopeo.1.md Outdated

**--authfile** _path_

Path of the authentication file. Default is ${XDG_RUNTIME\_DIR}/containers/auth.json, which is set using `kpod login`
Copy link
Member

Choose a reason for hiding this comment

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

Missing period after kpod login. A mention of precedence would probably be good here too. Perhaps: "Default is ${XDG_RUNTIME_DIR}/containers/auth.json, which is set using kpod login. If the authorization state is not found there, then $HOME/.docker/config.json is checked, which is set using docker login."

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

skopeo copy, delete, and inspect can now use credentials stored in the auth file
by the kpod login command
e.g kpod login docker.io -> skopeo copy dir:mydir docker://username/image

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
@umohnani8
Copy link
Member Author

Tests passed

@mtrmac mtrmac merged commit 04e04ed into containers:master Nov 21, 2017
@mtrmac mtrmac mentioned this pull request Jul 12, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants