compose: docker-compose can't handle when docker-credential-osxkeychain is gone

Description of the issue

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.24.0-rc1, build 0f3d4dda
docker-py version: 3.7.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.1.0h  27 Mar 2018

Output of docker version

Client: Docker Engine - Community
 Version:           18.09.1
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        4c52b90
 Built:             Wed Jan  9 19:33:12 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.1
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       4c52b90
  Built:            Wed Jan  9 19:41:49 2019
  OS/Arch:          linux/amd64
  Experimental:     true

Output of docker-compose config (Make sure to add the relevant -f and other flags)

ERROR: 
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml

Steps to reproduce the issue

  1. Open Docker for Mac preferences

  2. Uncheck "Securely store Docker logins in macOS keychain

  3. docker-compose up

Observed result

traceback

Expected result

containers start running

Stacktrace / full error message

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 71, in main
  File "compose/cli/main.py", line 127, in perform_command
  File "compose/cli/main.py", line 1085, in up
  File "compose/cli/main.py", line 1081, in up
  File "compose/project.py", line 527, in up
  File "compose/service.py", line 344, in ensure_image_exists
  File "compose/service.py", line 1084, in build
  File "site-packages/docker/api/build.py", line 260, in build
  File "site-packages/docker/api/build.py", line 307, in _set_auth_headers
  File "site-packages/docker/auth.py", line 301, in get_all_credentials
  File "site-packages/docker/auth.py", line 287, in _get_store_instance
  File "site-packages/dockerpycreds/store.py", line 25, in __init__
dockerpycreds.errors.InitializationError: docker-credential-osxkeychain not installed or not available in PATH
[63650] Failed to execute script docker-compose

Additional information

OS version / distribution, docker-compose install method, etc.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 9
  • Comments: 25 (6 by maintainers)

Most upvoted comments

@ssbarnea You’ll need to edit your CLI config file manually.

If you would like to use the macOS keychain then you need to:

  1. Make sure that you have the option checked in the Docker Desktop preferences
  2. Ensure that your ~/.docker/config.json file contains "credsStore" : "osxkeychain"
  3. Login to the registry that you want to use

If you would not like to use the macOS keychain then you need to:

  1. Make sure that the option is unchecked in the Docker Desktop preferences
  2. Ensure that your ~/.docker/config.json does not contain "credsStore": "osxkeychain"
  3. Login to the registry that you want to use

Let me know if you run into any trouble

I had this:

cat ~/.docker/config.json

{"auths":{},"credsStore":"", "credsStore":"desktop","stackOrchestrator":"swarm"}

I updated to this:

{"auths":{},"credsStore":"","stackOrchestrator":"swarm"}

Now docker-compose build is working again 😃

@ssbarnea You’ll need to edit your CLI config file manually.

If you would like to use the macOS keychain then you need to:

  1. Make sure that you have the option checked in the Docker Desktop preferences
  2. Ensure that your ~/.docker/config.json file contains "credsStore" : "osxkeychain"
  3. Login to the registry that you want to use

If you would not like to use the macOS keychain then you need to:

  1. Make sure that the option is unchecked in the Docker Desktop preferences
  2. Ensure that your ~/.docker/config.json does not contain "credsStore": "osxkeychain"
  3. Login to the registry that you want to use

Let me know if you run into any trouble

Thank you! Your post helped me a lot. One addition: I didn’t have “credsStore”: “osxkeychain”, I had “credsStore”:“desktop”. I had to remove this whole entry and then I could build successfully.

This might be caused by an issue in Docker Desktop which is storing if it is using the keychain in ~/.docker/config.json with the incorrect key: "credSstore" : "osxkeychain" instead of credsStore.

I’ve raised this with them and will keep this issue updated.

From the Docker Desktop icon, I logged in to the Docker (clicking the Sign in / Create Docker ID) and after that I was able to run again the docker commands.

I can confirm that this occurred after an OSX upgrade of Docker to 2.1.0.0 36874. I had 2 credsStore entries and one of them has the capitalized S in the wrong place. After deleting “credsStore”:“desktop” and editing so that all I had was “credsStore”:“”, docker-compose --build worked.

I just deleted the credStore key in my ~/.docker/config.json and restarted Docker…that fixed it.

This started happening to me as well with edge 2.0.2.1 (311274) and presents the same regardless of if “securely store docker logins in macOS keychain” is selected. Note that when it’s deselected then I don’t get the first error @ineffyble gets.

If I log in with dockerID via the Docker Desktop menu GUI, the errors go away and docker-compose works.

If I log back out, it still works without errors, so there’s something happening that is “cleared out” by logging out and back in.

First login: docker login

Then try again: docker-compose up

Downgrading is how I made it work.

  1. Close any terminal you had opened.
  2. Delete your previous Docker for Desktop from your system (by simply removing it from your Applications).
  3. Download the latest stable release Docker Community Edition 2.0.0.3 2019-02-15: https://download.docker.com/mac/stable/31259/Docker.dmg.
  4. (Be careful not to delete unwanted info from your config) Initialize your credentials configuration by running: docker-credential-gcr configure-docker

None of the suggestions worked for me. As I pointed out here; the problem occurred to me when upgrading to stable/2.1.0.0.

Please let’s find a truly reliable solution for this, instead of patchy workarounds.

Yeah and weird thing, although I didn’t really think about it at the time was that the key was “credSstore” and not what I expected “credsStore”. The wrong S in the key was capitalised

I had the "credsStore": "osxkeychain" twice in my config.json, after removing one the issue is gone.

and just delete the files in the folder and everything goes back to normal ~/.docker