Skip to content
LatchkeyLatchkey home

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.com

Common 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.

Frequently asked questions

docker logout: Clear Registry Credentials?
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 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

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card