From f7b9168649965d3bad465611df7a6c61948ef2ad Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 28 Mar 2024 11:14:41 -0400 Subject: [PATCH] docs/podman-login: Give an example of writing the persistent path The way `podman login` works by default is fundamentally different from `docker login` and this causes a lot of confusion, and I have seen multiple bad suggestions for ways to address this such as setting `XDG_RUNTIME_DIR`. Let's document up front how to write to the persistent path. Signed-off-by: Colin Walters --- docs/source/markdown/podman-login.1.md.in | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/source/markdown/podman-login.1.md.in b/docs/source/markdown/podman-login.1.md.in index 8ec9fccc6a..ad94573423 100644 --- a/docs/source/markdown/podman-login.1.md.in +++ b/docs/source/markdown/podman-login.1.md.in @@ -69,7 +69,10 @@ print detailed information about credential store ## EXAMPLES -Add login credentials for specified registry to default authentication file. +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 emphemeral directory) and hence do not persist across reboot. + ``` $ podman login quay.io Username: umohnani @@ -77,6 +80,16 @@ 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