且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-11-12 16:26:12

当您登录时,您的用户名和注册表显示在 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注册表