Add secret support to podman login

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2023-06-30 07:00:10 -04:00
parent 958191aedc
commit d497eb369c
4 changed files with 92 additions and 3 deletions

View File

@ -48,6 +48,11 @@ Password for registry
Take the password from stdin
#### **--secret**=*name*
Read the password for the registry from the podman secret `name`.
If --username is not specified --username=`name` is used.
@@option tls-verify
#### **--username**, **-u**=*username*
@ -79,6 +84,13 @@ 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!
@ -108,7 +120,7 @@ Login Succeeded!
```
## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-logout(1)](podman-logout.1.md)**, **[containers-auth.json(5)](https://github.com/containers/image/blob/main/docs/containers-auth.json.5.md)**, **[containers-certs.d(5)](https://github.com/containers/image/blob/main/docs/containers-certs.d.5.md)**, **[containers-registries.conf(5)](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md)**
**[podman(1)](podman.1.md)**, **[podman-logout(1)](podman-logout.1.md)**, **[containers-auth.json(5)](https://github.com/containers/image/blob/main/docs/containers-auth.json.5.md)**, **[containers-certs.d(5)](https://github.com/containers/image/blob/main/docs/containers-certs.d.5.md)**, **[containers-registries.conf(5)](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md)**, **[podman-secret(1)](podman-secret.1.md)**, **[podman-secret-create(1)](podman-secret-create.1.md)**
## HISTORY
August 2017, Originally compiled by Urvashi Mohnani <umohnani@redhat.com>

View File

@ -18,6 +18,8 @@ TLS certificates and keys, SSH keys or other important generic strings or binary
Secrets are not committed to an image with `podman commit`, and does not get committed in the archive created by a `podman export` command.
Secrets can also be used to store passwords for `podman login` to authenticate against container registries.
## OPTIONS
#### **--driver**, **-d**=*driver*
@ -55,7 +57,7 @@ $ printf <secret> | podman secret create my_secret -
```
## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-secret(1)](podman-secret.1.md)**
**[podman(1)](podman.1.md)**, **[podman-secret(1)](podman-secret.1.md)**, **[podman-login(1)](podman-login.1.md)**
## HISTORY
January 2021, Originally compiled by Ashley Cui <acui@redhat.com>