Docker Push Authentication Error (Troubleshooting)
When CLI tries to push Docker image to registry, authentication error may occur when Docker doesn't send credentials to the registry.
Resolution:
MacOS
- Open Docker Desktop
- Go to Settings → Docker Engine
- Add to JSON configuration:
json
{
"insecure-registries": ["host.docker.internal:49984"]
}Complete example:
json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"features": {
"buildkit": true
},
"insecure-registries": [
"host.docker.internal:49984"
]
}- Click Apply & Restart
Linux
- Edit
/etc/docker/daemon.json(create if doesn't exist):
json
{
"insecure-registries": ["localhost:49984"]
}- Restart Docker:
bash
sudo systemctl restart dockerWindows
- Open Docker Desktop
- Go to Settings → Docker Engine
- Add to JSON configuration:
json
{
"insecure-registries": ["host.docker.internal:49984"]
}- Click Apply & Restart
Purpose: Allows Docker to send requests to local proxy which handles authentication.