We have our own private registry for the docker images. I get no basic auth credentials
after executing command docker push image_name
. Has it to do with access rights to push newly build image on the private registry?
Asked
Active
Viewed 9,310 times
2

NRP
- 452
- 1
- 5
- 12
1 Answers
3
It seems your below file is not configured with the auths.
~/.docker/config.json
Update your config.json and add auths if not present already like below sample example.
{
"auths": {
"<account>.dkr.ecr.us-east-1.amazonaws.com": {},
"https://<account>.dkr.ecr.us-east-1.amazonaws.com": {},
"https://index.docker.io/v1/": {}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.2 (darwin)"
},
"credsStore": "<value>",
"stackOrchestrator": "<value>"
}

Pacifist
- 3,025
- 2
- 12
- 20
-
Thank you for the answer. I cross checked in my `/home/` and I do not have this `config.json` file. Is it a autogenerated file? – NRP Sep 04 '19 at 08:18
-
Yes. You can log into any public or private repository for which you have credentials. When you log in, the command stores credentials in $HOME/.docker/config.json on Linux. – Pacifist Sep 04 '19 at 08:21
-
Well this resolved my issue. Thank you @Pacifist_AWS :) – NRP Sep 10 '19 at 15:14
-
1That's the correct config file but you shouldn't edit this file directly, use `docker login your_private_registry.com` instead and it will fill it automatically. – Tomasz W Nov 23 '21 at 12:03