MacのDocker でPostgresqlを使おうとしたらエラーが出てしまった
Mac OS X 10.15 の Docker で Postgresql を使おうとしたらエラーが出てしまいました。
$ docker-compose up -d
Building postgres Traceback (most recent call last): File "site-packages/docker/credentials/store.py", line 80, in _execute File "subprocess.py", line 411, in check_output File "subprocess.py", line 512, in run subprocess.CalledProcessError: Command '['/usr/local/bin/docker-credential-desktop', 'get']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "site-packages/docker/auth.py", line 264, in _resolve_authconfig_credstore File "site-packages/docker/credentials/store.py", line 35, in get File "site-packages/docker/credentials/store.py", line 93, in _execute docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "error getting credentials - err: exit status 1, out: `User interaction is not allowed.`". During handling of the above exception, another exception occurred: Traceback (most recent call last): File "docker-compose", line 3, inFile "compose/cli/main.py", line 67, in main File "compose/cli/main.py", line 126, in perform_command File "compose/cli/main.py", line 1070, in up File "compose/cli/main.py", line 1066, in up File "compose/project.py", line 615, in up File "compose/service.py", line 362, in ensure_image_exists File "compose/service.py", line 1125, in build File "site-packages/docker/api/build.py", line 261, in build File "site-packages/docker/api/build.py", line 308, in _set_auth_headers File "site-packages/docker/auth.py", line 304, in get_all_credentials File "site-packages/docker/auth.py", line 281, in _resolve_authconfig_credstore docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop exited with "error getting credentials - err: exit status 1, out: `User interaction is not allowed.`".')
長かったの面食らいましたが、どうやら認証が上手くいってなさそうなエラー表示です。
解決方法
こちらが非常に参考になりました。
Mac で docker login や docker-compose build や up 時に User interaction is not allowed エラー。はたまた docker.credentials.errors.StoreError のたぐい
$ security unlock-keychain
このコマンドを実行することによって上手くいくようになりました。感謝です。