NAME

Podman-登录-登录到容器注册表

SYNOPSIS

podman login [options] [registry]

DESCRIPTION

podman login logs into a specified registry server with the correct username and password. If the registry is not specified, the first registry under [registries.search] from registries.conf is used. podman login reads in the username and password from STDIN. The username and password can also be set using the username and password flags. The path of the authentication file can be specified by the user by setting the authfile flag. The default path for reading and writing credentials is ${XDG_RUNTIME_DIR}/containers/auth.json. Podman uses existing credentials if the user does not pass in a username. Podman first searches for the username and password in the ${XDG_RUNTIME_DIR}/containers/auth.json, if they are not valid, Podman then uses any existing credentials found in $HOME/.docker/config.json. If those credentials are not present, Podman creates ${XDG_RUNTIME_DIR}/containers/auth.json (if the file does not exist) and then stores the username and password from STDIN as a base64 encoded string in it. For more details about format and configurations of the auth.json file, see containers-auth.json(5)

[podman [GLOBAL OPTIONS]]

[podman login [GLOBAL OPTIONS]]

[podman login [OPTIONS] [REGISTRY] [GLOBAL OPTIONS]]

OPTIONS

--authfile = path

身份验证文件的路径。缺省值为 ${XDG_RUNTIME_DIR}/containers/auth.json 在Linux上,以及 $HOME/.config/containers/auth.json 在Windows/MacOS上。该文件由创建 podman login 。如果在那里找不到授权状态, $HOME/.docker/config.json 被选中,它是使用 docker login

注意:还可以通过设置 REGISTRY_AUTH_FILE 环境变量这可以通过以下方式完成 export REGISTRY_AUTH_FILE=path

--cert-dir = path

在以下位置使用证书 path (\ *.crt, * .cert,\ *.key) to connect to the registry. (Default: /etc/containers/certs.d) For details, see * containers-certs.d(5) *。(此选项不适用于远程Podman客户端,包括Mac和Windows(不包括WSL2)计算机)

--compat-auth-file = path

不是更新默认凭据文件,而是在 path ,并使用与Docker兼容的格式。

--get-login

返回注册表的登录用户。如果找不到登录,则返回错误。

--help-h

打印用法报表

--password-p = 密码

注册表密码

--password-stdin

从标准输入中获取密码

--secret = name

从Podman密码中读取注册表的密码 name 。如果未指定--用户名,则使用用户名=名称

--tls-verify

联系注册处时要求HTTPS并验证证书(默认: true )。如果显式设置为 true ,使用TLS验证。如果设置为 false ,不使用TLS验证。如果未指定,则使用TLS验证,除非目标注册表在 containers-registries.conf(5)

--username-u = 用户名

注册表的用户名

--verbose-v

打印有关凭据存储的详细信息

EXAMPLES

将指定注册表的登录凭据添加到默认身份验证文件;请注意,与 docker 默认情况下,默认凭据位于 $XDG_RUNTIME_DIR 它是的子目录 /run (一个重要的临时目录),因此在重新启动后不会持续存在。

$ podman login quay.io
Username: umohnani
Password:
Login Succeeded!

要在重新启动后显式保留凭据,您需要指定默认永久路径:

$ podman login --authfile ~/.config/containers/auth.json quay.io
Username: umohnani
Password:
Login Succeeded!

使用本地注册表的指定用户名和密码将登录凭据添加到默认身份验证文件。

$ podman login -u testuser -p testpassword localhost:5000
Login Succeeded!

为指定注册表的备用身份验证文件路径添加登录凭据。

$ podman login --authfile authdir/myauths.json quay.io
Username: umohnani
Password:
Login Succeeded!

使用Podman密码添加登录凭据。

$ echo -n MySecret! | podman secret create secretname -
a0ad54df3c97cf89d5ca6193c
$ podman login --secret secretname -u testuser quay.io
Login Succeeded!

将用于密码测试的用户测试的登录凭据添加到本地主机:5000注册表,禁用TLS验证要求。

$ podman login --tls-verify=false -u test -p test localhost:5000
Login Succeeded!

使用证书目录/etc/tainers/certs.d将带有密码栏的用户foo的登录凭据添加到本地主机:5000注册表。

$ podman login --cert-dir /etc/containers/certs.d/ -u foo -p bar localhost:5000
Login Succeeded!

将指定注册表的登录凭据添加到给定用户的默认身份验证文件中,该文件具有通过磁盘上的文件中的标准输入提供的密码信息。

$ podman login -u testuser  --password-stdin < testpassword.txt docker.io
Login Succeeded!

使用通过管道中的标准输入提供的密码信息,将指定注册表的登录凭据添加到给定用户的默认身份验证文件。

$ echo $testpassword | podman login -u testuser --password-stdin quay.io
Login Succeeded!

在详细模式下将指定注册表的登录凭据添加到默认身份验证文件。

$ podman login quay.io --verbose
Username: myusername
Password:
Used: /run/user/1000/containers/auth.json
Login Succeeded!

另请参阅

podman(1)podman-logout(1)containers-auth.json(5)containers-certs.d(5)containers-registries.conf(5)podman-secret(1)podman-secret-create(1)

HISTORY

2017年8月,最初由Urvashi Mohnaniumohnani@redhat.com汇编