Docker push authentication error
When the CLI tries to push a Docker image to the registry, you might encounter an authentication error. This error sometimes occurs for users when Docker doesn't send any credentials to the registry. To resolve this issue, you can use the following steps:
MacOS
- Open Docker Desktop.
- Go to Settings.
- Go to Docker Engine.
- Add the following line to the json configuration:
{
"insecure-registries": ["host.docker.internal:49984"]
}
It may look like this:
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"features": {
"buildkit": true
},
"insecure-registries": [
"host.docker.internal:49984"
]
}
This allows Docker to send requests to local proxy, which handles the authentication.
- Click Apply & Restart.
Linux
- Edit the Docker configuration file (usually
/etc/docker/daemon.json
) and add the following line, if the file doesn't exist, create it:
{
"insecure-registries": ["localhost:49984"]
}
- Restart Docker:
sudo systemctl restart docker
Windows
- Open Docker Desktop.
- Go to Settings.
- Go to Docker Engine.
- Add the following line to the json configuration:
{
"insecure-registries": ["host.docker.internal:49984"]
}
- Click Apply & Restart.