To create a valid .docker/config.json file you first need to base64 encode your username and password:
echo <username>:<password> | base64The output will look like this:
~ echo hallo:welt | base64
aGFsbG86d2VsdAo=Then you can create your config.json file:
echo '{
"auths": {
"https://index.docker.io/v1/": {
"auth": "XXX"
}
}
}' > config.jsonThen open the file and exchange XXX with the encoded username/password you created earlier.
If you need to create a config for another registry, exchange https://index.docker.io/v1/ with the url of the custom registry.