Docker:Mac 上执行 docker-compose up 时返回 [16058] Failed to execute script docker-compose 报错

环境

MacOS 10.12.6

问题

执行 docker-compose up 命令时,遇到 [16029] Failed to execute script docker-compose 报错。

报错

Creating network "docker-mac-network_default" with the default driver
Building proxy
Traceback (most recent call last):
File "site-packages/dockerpycreds/store.py", line 80, in _execute
File "subprocess.py", line 356, in check_output
File "subprocess.py", line 438, 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/dockerpycreds/store.py", line 35, in get
File "site-packages/dockerpycreds/store.py", line 93, in _execute
dockerpycreds.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 6, in
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 360, 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 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.".',)
[16029] Failed to execute script docker-compose
如图:

image.png

原因

Docker 默认设置,将Docker登录安全地存储在MacOS密钥链中造成的,取消这个设置就可以解决,具体细节请自行谷歌。

解决

  • 依次点击 :Docker 图标 >> Preference >> General
  • 取消勾选 Securely store Docker logins in macOS keychian,
    如下图:


    image.png
  • 重新运行 docker-compose up ,问题解决。

联系博主:下为博主微信,欢迎骚扰

image.png

你可能感兴趣的:(Docker:Mac 上执行 docker-compose up 时返回 [16058] Failed to execute script docker-compose 报错)