docker logout: Clear Registry Credentials
Remove stored credentials for a registry.
docker logout removes the cached credentials for a registry from the Docker config. This page covers when it matters, especially on shared or persistent CI runners.
What it does
docker logout REGISTRY deletes the stored auth entry for that registry in ~/.docker/config.json. Without an argument it logs out of Docker Hub.
Common usage
Terminal
docker logout
docker logout ghcr.io
docker logout 123456789.dkr.ecr.us-east-1.amazonaws.comCommon errors in CI
On ephemeral runners logout is rarely needed because the filesystem is discarded. On self-hosted or persistent runners, leftover credentials in ~/.docker/config.json can leak between jobs - log out (or remove the config) at the end of a job. logout of a registry you were not logged into is a no-op, not an error.
Related guides
docker login: Authenticate to a Registry in CIHow docker login works: authenticating to Docker Hub, GHCR, or ECR with a token from stdin, and the auth erro…
docker push: Usage, Options & Auth Errors in CIHow docker push works: uploading a tagged image to a registry, naming requirements, and the denied/unauthoriz…
docker pull: Usage, Options & Rate-Limit ErrorsHow docker pull works: fetching images from a registry, digests and platforms, and fixing Docker Hub rate-lim…