20884f
% containers-auth.json(5)
20884f
20884f
# NAME
20884f
containers-auth.json - syntax for the registry authentication file
20884f
20884f
# DESCRIPTION
20884f
20884f
A credentials file in JSON format used to authenticate against container image registries.
20884f
The primary (read/write) file is stored at `${XDG_RUNTIME_DIR}/containers/auth.json` on Linux;
20884f
on Windows and macOS, at `$HOME/.config/containers/auth.json`.
20884f
20884f
When searching for the credential for a registry, the following files will be read in sequence until the valid credential is found:
20884f
first reading the primary (read/write) file, or the explicit override using an option of the calling application.
20884f
If credentials are not present, search in `${XDG\_CONFIG\_HOME}/containers/auth.json`, `$HOME/.docker/config.json`, `$HOME/.dockercfg`.
20884f
20884f
Except the primary (read/write) file, other files are read-only, unless the user use an option of the calling application explicitly points at it as an override.
20884f
20884f
20884f
## FORMAT
20884f
20884f
The auth.json file stores encrypted authentication information for the
20884f
user to container image registries.  The file can have zero to many entries and
20884f
is created by a `login` command from a container tool such as `podman login`,
20884f
`buildah login` or `skopeo login`.  Each entry includes the name of the registry and then an auth
20884f
token in the form of a base64 encoded string from the concatenation of the
20884f
username, a colon, and the password.
20884f
20884f
The following example shows the values found in auth.json after the user logged in to
20884f
their accounts on quay.io and docker.io:
20884f
20884f
```
20884f
{
20884f
	"auths": {
20884f
		"docker.io": {
20884f
			"auth": "erfi7sYi89234xJUqaqxgmzcnQ2rRFWM5aJX0EC="
20884f
		},
20884f
		"quay.io": {
20884f
			"auth": "juQAqGmz5eR1ipzx8Evn6KGdw8fEa1w5MWczmgY="
20884f
		}
20884f
	}
20884f
}
20884f
```
20884f
20884f
An entry can be removed by using a `logout` command from a container
20884f
tool such as `podman logout` or `buildah logout`.
20884f
20884f
In addition, credential helpers can be configured for specific registries and the credentials-helper
20884f
software can be used to manage the credentials in a more secure way than depending on the base64 encoded authentication
20884f
provided by `login`.  If the credential helpers are configured for specific registries, the base64 encoded authentication will not be used
20884f
for operations concerning credentials of the specified registries.
20884f
20884f
When the credential helper is in use on a Linux platform, the auth.json file would contain keys that specify the registry domain, and values that specify the suffix of the program to use (i.e. everything after docker-credential-).  For example:
20884f
20884f
```
20884f
{
20884f
    "auths": {
20884f
        "localhost:5001": {}
20884f
    },
20884f
    "credHelpers": {
20884f
		"registry.example.com": "secretservice"
20884f
	}
20884f
}
20884f
```
20884f
20884f
For more information on credential helpers, please reference the [GitHub docker-credential-helpers project](https://github.com/docker/docker-credential-helpers/releases).
20884f
20884f
# SEE ALSO
20884f
    buildah-login(1), buildah-logout(1), podman-login(1), podman-logout(1), skopeo-login(1), skopeo-logout(1)
20884f
20884f
# HISTORY
20884f
Feb 2020, Originally compiled by Tom Sweeney <tsweeney@redhat.com>