If you are unable to log in to Docker, you may need to set your credentials manually.
The Docker command line tool supports authenticating sensitive operations, such as push, with the server using basic HTTP authentication.
To enforce authenticated access to docker repositories you need to provide the following parameters to the Docker configuration file.
The Docker endpoint URL (must use HTTPS for basic authentication to work)
Your Artifactory username and password (formatted
username:password) as Base64 encoded stringsYour email address
You can use the following command to get these strings directly from Artifactory:
Get config.json entries directly from Artifactory
$ curl -uadmin:password "https://<JFROG_PLATFORM_URL>/artifactory/api/docker/<REPO_NAME>/<v1|v2>/auth"
The command returns credentials that you can paste into your ~/.docker/config.json file. For example:
{
"https://artprod.company.com" : {
"auth" : "YWRtaW46QVA1N05OaHZTMnM5Qk02RkR5RjNBVmF4TVFl",
"email" : "admin@email.com"
}
}The Docker configuration file may contain a separate authentication block for each registry that you wish to access. For example:
{
"https://artprod.company.com": {
"auth":"YWRtaW46cGFzc3dvcmQ=",
"email":"myemail@email.com"
},
"https://artprod2.company.com": {
"auth":"YWRtaW46cGFzc3dvcmQ=",
"email":"myemail@email.com"
}
}