logout
Clears in-memory cached Docker registry credentials. Specify a registry key to remove a single entry, or leave empty to clear all.
Instructions
Clear cached registry credentials from this server's in-memory Docker client.
docker-py / the Engine have no true logout: login validates against the registry (the daemon's
/auth is stateless) and caches credentials in-process. This drops that in-memory cache; it does
NOT contact the daemon or touch the host's ~/.docker/config.json. With no registry, clears
every cached credential; pass one to clear just that entry (key must match login; Docker Hub is
cached under "docker.io"). close/reconnect also clear it by discarding the client.
Reaches into a private docker-py attribute (api._auth_configs); degrades to clearing nothing if
that internal shape changes.
args: registry - Registry key to clear, or None to clear every cached credential host - host label whose client cache to clear (default: the default host) returns: dict - {"cleared": []}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| registry | No |