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)计算机)

--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

$ podman login docker.io
Username: umohnani
Password:
Login Succeeded!
$ podman login -u testuser -p testpassword localhost:5000
Login Succeeded!
$ podman login --authfile authdir/myauths.json docker.io
Username: umohnani
Password:
Login Succeeded!
$ echo -n MySecret! | podman secret create secretname -
a0ad54df3c97cf89d5ca6193c
$ podman login --secret secretname -u testuser quay.io
Login Succeeded!
$ podman login --tls-verify=false -u test -p test localhost:5000
Login Succeeded!
$ 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 docker.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汇编