podman-login(1)

โœจ podman-login(1) โ€” Log in to a container registry ๐Ÿ’…

okay bestie, listen up, this is the podman login manual page (yep, that's the podman-login(1) one, General Commands Manual vibes) and it is lowkey the glow-up your registry credentials have been waiting for ๐Ÿซถ

๐ŸŒธ NAME ๐ŸŒธ

podman-login โ€” log in to a container registry ๐Ÿ”


โœจ SYNOPSIS โœจ

podman login [options] [registry]

๐Ÿ’– DESCRIPTION ๐Ÿ’–

So like, podman login logs you into a registry server with the correct username and password. That's it, that's the whole girlboss move ๐Ÿ‘‘

If you don't specify the registry? No stress, it uses the first registry under [registries.search] from registries.conf. Periodt.

Here's the tea on how it gets your creds:

  • podman login reads the username and password from STDIN ๐Ÿ“ฅ
  • you can also set them with the username and password flags
  • you can pick where the auth file lives with the authfile flag
  • the default path for reading and writing credentials is ${XDG_RUNTIME_DIR}/containers/auth.json

Podman is not about to make you retype stuff. If you don't pass in a username, it uses existing credentials. The order it goes in is:

  1. it first searches for the username and password in ${XDG_RUNTIME_DIR}/containers/auth.json
  2. if those aren't valid, it then uses any existing credentials found in $HOME/.docker/config.json
  3. if those credentials aren't present either, Podman creates ${XDG_RUNTIME_DIR}/containers/auth.json (only if the file doesn't 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).

And the invocation shapes, because we love options:

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

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • --authfile=path โ€” the path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json on Linux, and $HOME/.config/containers/auth.json on Windows/macOS ๐Ÿ–ฅ๏ธ The file is created by podman login. If the authorization state isn't found there, $HOME/.docker/config.json is checked, which is the one set using docker login.
Note: you can also override the default path of the authentication file by setting the REGISTRY_AUTH_FILE environment variable. Do it like this: export REGISTRY_AUTH_FILE=path ๐Ÿ’ซ
  • --cert-dir=path โ€” use certificates at path (*.crt, *.cert, *.key) to connect to the registry. (Default: /etc/containers/certs.d) For details, see containers-certs.d(5). ๐Ÿงš (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines โ€” sad, I know ๐Ÿ˜ญ)
  • --compat-auth-file=path โ€” instead of updating the default credentials file, update the one at path, and use a Docker-compatible format ๐Ÿณ
  • --get-login โ€” return the logged-in user for the registry. Returns an error if no login is found. Bestie, if there's nothing there, it's gonna tell you ๐Ÿ’€
  • --help, -h โ€” print usage statement ๐Ÿ“œ
  • --password, -p=password โ€” password for registry ๐Ÿคซ
  • --password-stdin โ€” 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 ๐ŸŽ
  • --tls-verify โ€” require HTTPS and verify certificates when contacting registries (default: true). If explicitly set to true, TLS verification is used. If set to false, TLS verification is not used. If not specified, TLS verification is used unless the target registry is listed as an insecure registry in containers-registries.conf(5) ๐Ÿ”’
  • --username, -u=username โ€” username for registry ๐Ÿชช
  • --verbose, -v โ€” print detailed information about credential store ๐Ÿ‘€

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

Add login credentials for specified registry to default authentication file; note that unlike the docker default, the default credentials are under $XDG_RUNTIME_DIR which is a subdirectory of /run (an ephemeral directory) and hence do not persist across reboot ๐Ÿ˜ญ

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

To explicitly preserve credentials across reboot, you will need to specify the default persistent path โœจ

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

Add login credentials using specified username and password for local registry to default authentication file ๐Ÿ’…

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

Add login credentials for alternate authfile path for the specified registry ๐Ÿ—‚๏ธ

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

Add login credentials using a Podman secret for the password ๐Ÿคซ

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

Add login credentials for user test with password test to localhost:5000 registry disabling tls verification requirement ๐Ÿ™ˆ

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

Add login credentials for user foo with password bar to localhost:5000 registry using the certificate directory /etc/containers/certs.d ๐Ÿ“œ

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

Add login credentials for specified registries to default authentication file for given user with password information provided via stdin from a file on disk ๐Ÿ“

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

Add login credentials for specified registry to default authentication file for given user with password information provided via stdin from a pipe ๐Ÿชˆ

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

Add login credentials for specified registry to default authentication file in verbose mode ๐Ÿ”

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

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

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 ๐Ÿ’œ

August 2017, Originally compiled by Urvashi Mohnani umohnani@redhat.com โŸจmailto:umohnani@redhat.comโŸฉ


okay that's the whole page bestie, you ate that ๐ŸŽ€ this was podman-login(1) from the General Commands Manual, originally compiled back in August 2017 by Urvashi Mohnani โ€” go log into something and slay, iykyk ๐Ÿ’–โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from