如何知道docker是否已经登录到docker注册表服务器

问题描述:

我不知道我是否已经使用cmd:docker login登录到cmd line中的docker注册表。如何测试或看看您是否登录,而不尝试推?

I'm not sure if I have already logged in to a docker registry in cmd line by using cmd: docker login. How can you test or see whether you are logged in or not, without trying to push?

当您登录时,您的用户名和注册表显示在 docker info 命令

When you are logged in, your username and registry shows up in the docker info command

像这样:

[ciccio@consolecowboy.net ~]$ docker info
Containers: 12
 Running: 2
..etc...
...
Username: francobolli
Registry: https://index.docker.io/v1/

编辑:注意;这仅适用于 index.docker.io repo。登录仅在需要时将凭据存储在磁盘上,例如运行 docker pull localhost:5000 / image docker pull quay.io/username / reponame

Edit: Note; this only works for index.docker.io repo. Login only stores the credentials on disk when it needs them, for example when running docker pull localhost:5000/image or docker pull quay.io/username/reponame.

在这个问题:我怎么知道我是否登录了一个私人docker注册表