kompose: Unable to push Docker image for service web: Unable to retrieve .docker/config.json authentication details.
I got this error while running: kompose up
I have been using the following docker-compose.yml:
version: ‘3’
services: db: image: mysql:5.5 container_name: db-container ports: - “3406:3306” environment: MYSQL_ROOT_PASSWORD: mypassword MYSQL_USER: root MYSQL_DATABASE: mydb web: build: . container_name: web-container command: python3 manage.py runserver 0.0.0.0:8000 volumes: - .:/code image: “ruddra/web-image” ports: - “8000:8000” depends_on: - db
I ran the following commands:
kompose convert --provider=openshift kompose up --provider=openshift
I was able to push to my dockerhub repository using:
docker-compose push
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 30 (10 by maintainers)
I pushed it manually and removed build from compose file. It worked!
It feels like
komposeis having issues accessing the credentials to push the images.First thank you very much, solve my problems, here I have some supplements. “base64encoded credentials” can be generated by
echo -n “username:password” | base64 -n used to omit ‘\n’ which added by echo
@cdrage , I’ve found out what’s the problem. It’s because dockerclient isn’t integrated with osxkeychain. See https://github.com/fsouza/go-dockerclient/issues/677
Also it relates to https://github.com/docker/for-mac/issues/1584 Docker for Mac by default uses osxkeychain for storing credentials.
So the current solution is to edit config.json:
{ "auths": { "localhost:5000": { "auth": "...base64encoded credentials..." } }, "credsStore": "osxkeychain" }And need to ensure that there are no auths without auth string (https://github.com/fsouza/go-dockerclient/issues/677#issuecomment-360269441 ).So I solved this on OSX by disabling the keychain password storage:
rm ~/.docker/config.json(maybe skip this part actually)docker loginOr for glcoud and pushing to gcr:
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://eu.gcr.ionow your
~/.docker/config.jsonshould contain base64 encoded passwords. Working, not safe though!If someone gets the keychain storage to work that would be nice…
This is still not working properly. I have no idea what’s the problem (permissions? corrupted cache?)
note that both docker and docker-compose are pushing properly and I am running macOS 10.14 Mojave.
It seems like a file permission issue with kubernetes, which I’ve installed via homebrew. Also my kubectl is not reading anything from my desktop folder.
So I’d like to add a bit to what everyone else has said. The message
WARN Unable to retrieve .docker/config.json authentication detailsseems to be caused by there being ANY emptyauthobjects in the~/.docker/config.jsonfile.docker loginin many cases seems to create emptyauthblocks so doing as the warning tells you can actually make this problem happen. Now if you, like me, do not want to put your personal google credentials into a text file, there is a way to make this work for a JSON key file (as described here https://cloud.google.com/container-registry/docs/advanced-authentication#json_key_file).Once you have the key file, you can generate a base-64-encoded auth block using the same method they use for the
docker logincommand. Combining that with the answer above from @eic-aibee , what you want to do is run this command:echo -n "_json_key:$(cat key.json)" | base64which will spit out the auth block to the console.@huntal seems like not a kompose issue, because docker-compose push is not working too. Maybe wrong dockerhub user namespace. The output shows that you are trying to push to
library, this is the official image account… The image format is<you-user-name>/<image-name>:<tag>I think.