1podman-login(1) General Commands Manual podman-login(1)
2
3
4
6 podman-login - Log in to a container registry
7
8
10 podman login [options] [registry]
11
12
14 podman login logs into a specified registry server with the correct
15 username and password. If the registry is not specified, the first reg‐
16 istry under [registries.search] from registries.conf is used. podman
17 login reads in the username and password from STDIN. The username and
18 password can also be set using the username and password flags. The
19 path of the authentication file can be specified by the user by setting
20 the authfile flag. The default path for reading and writing credentials
21 is ${XDG_RUNTIME_DIR}/containers/auth.json. Podman uses existing cre‐
22 dentials if the user does not pass in a username. Podman first
23 searches for the username and password in the ${XDG_RUNTIME_DIR}/con‐
24 tainers/auth.json, if they are not valid, Podman then uses any existing
25 credentials found in $HOME/.docker/config.json. If those credentials
26 are not present, Podman creates ${XDG_RUNTIME_DIR}/containers/auth.json
27 (if the file does not exist) and then stores the username and password
28 from STDIN as a base64 encoded string in it. For more details about
29 format and configurations of the auth.json file, see containers-
30 auth.json(5)
31
32
33 podman [GLOBAL OPTIONS]
34
35
36 podman login [GLOBAL OPTIONS]
37
38
39 podman login [OPTIONS] [REGISTRY] [GLOBAL OPTIONS]
40
41
43 --authfile=path
44 Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/contain‐
45 ers/auth.json on Linux, and $HOME/.config/containers/auth.json on Win‐
46 dows/macOS. The file is created by podman login. If the authorization
47 state is not found there, $HOME/.docker/config.json is checked, which
48 is set using docker login.
49
50
51 Note: There is also the option to override the default path of the au‐
52 thentication file by setting the REGISTRY_AUTH_FILE environment vari‐
53 able. This can be done with export REGISTRY_AUTH_FILE=path.
54
55
56 --cert-dir=path
57 Use certificates at path (*.crt, *.cert, *.key) to connect to the reg‐
58 istry. (Default: /etc/containers/certs.d) For details, see containers-
59 certs.d(5). (This option is not available with the remote Podman
60 client, including Mac and Windows (excluding WSL2) machines)
61
62
63 --get-login
64 Return the logged-in user for the registry. Return error if no login
65 is found.
66
67
68 --help, -h
69 Print usage statement
70
71
72 --password, -p=password
73 Password for registry
74
75
76 --password-stdin
77 Take the password from stdin
78
79
80 --secret=name
81 Read the password for the registry from the podman secret name. If
82 --username is not specified --username=name is used.
83
84
85 --tls-verify
86 Require HTTPS and verify certificates when contacting registries (de‐
87 fault: true). If explicitly set to true, TLS verification is used. If
88 set to false, TLS verification is not used. If not specified, TLS ver‐
89 ification is used unless the target registry is listed as an insecure
90 registry in containers-registries.conf(5)
91
92
93 --username, -u=username
94 Username for registry
95
96
97 --verbose, -v
98 print detailed information about credential store
99
100
102 $ podman login docker.io
103 Username: umohnani
104 Password:
105 Login Succeeded!
106
107
108
109 $ podman login -u testuser -p testpassword localhost:5000
110 Login Succeeded!
111
112
113
114 $ podman login --authfile authdir/myauths.json docker.io
115 Username: umohnani
116 Password:
117 Login Succeeded!
118
119
120
121 $ echo -n MySecret! | podman secret create secretname -
122 a0ad54df3c97cf89d5ca6193c
123 $ podman login --secret secretname -u testuser quay.io
124 Login Succeeded!
125
126
127
128 $ podman login --tls-verify=false -u test -p test localhost:5000
129 Login Succeeded!
130
131
132
133 $ podman login --cert-dir /etc/containers/certs.d/ -u foo -p bar localhost:5000
134 Login Succeeded!
135
136
137
138 $ podman login -u testuser --password-stdin < testpassword.txt docker.io
139 Login Succeeded!
140
141
142
143 $ echo $testpassword | podman login -u testuser --password-stdin docker.io
144 Login Succeeded!
145
146
147
148 $ podman login quay.io --verbose
149 Username: myusername
150 Password:
151 Used: /run/user/1000/containers/auth.json
152 Login Succeeded!
153
154
155
157 podman(1), podman-logout(1), containers-auth.json(5), containers-
158 certs.d(5), containers-registries.conf(5), podman-secret(1), podman-se‐
159 cret-create(1)
160
161
163 August 2017, Originally compiled by Urvashi Mohnani umohnani@redhat.com
164 ⟨mailto:umohnani@redhat.com⟩
165
166
167
168 podman-login(1)