Linux command
podman-login 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Login to Docker Hub
podman login docker.io
Login to specific registry
podman login [registry.example.com]
Login with credentials
podman login -u [username] -p [password] [registry]
Login with stdin password
echo [password] | podman login -u [user] --password-stdin [registry]
Check which user is logged in
podman login --get-login [registry]
Login using a TLS client certificate
podman login --cert-dir [/path/to/certs] [registry]
说明
podman login authenticates with container registries. Credentials are stored in an auth file (default: `${XDG_RUNTIME_DIR}/containers/auth.json`) for subsequent pulls and pushes. If no registry is specified, the first registry under `registries.search` from `registries.conf` is used. Supports Docker Hub, Quay.io, GitHub Container Registry, and private registries.
参数
- -u, --username _name_
- Registry username.
- -p, --password _pass_
- Registry password.
- --password-stdin
- Read password from stdin.
- --tls-verify
- Require HTTPS and verify TLS certificates when contacting registries (default: true).
- --authfile _file_
- Path to the authentication file (default: `${XDG_RUNTIME_DIR}/containers/auth.json`).
- --cert-dir _path_
- Use TLS certificates at _path_ (*.crt, *.cert, *.key) to connect to the registry.
- --compat-auth-file _path_
- Write credentials to _path_ in Docker-compatible format.
- --get-login
- Return the logged-in user for the registry. Returns an error if no login is found.
- --secret _name_
- Read the password from a podman secret.
- -v, --verbose
- Print detailed information about the credential store.
FAQ
What is the podman-login command used for?
podman login authenticates with container registries. Credentials are stored in an auth file (default: `${XDG_RUNTIME_DIR}/containers/auth.json`) for subsequent pulls and pushes. If no registry is specified, the first registry under `registries.search` from `registries.conf` is used. Supports Docker Hub, Quay.io, GitHub Container Registry, and private registries.
How do I run a basic podman-login example?
Run `podman login docker.io` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -u, --username _name_ do in podman-login?
Registry username.