docker-compose 不适用于 gcloud:找不到 OpenSSL

Nic*_*lta 8 ubuntu gcloud docker-compose

按照 gcloud CLI 中工件注册表的设置说明进行操作后,每当我使用 docker-compose 并尝试从注册表中获取图像时,都会出现此堆栈跟踪:

Pulling **** (europe-west2-docker.pkg.dev/****/****/****:latest)...
ERROR: gcloud failed to load: /tmp/_MEIsEW5sl/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/lib/python3.8/lib-dynload/_ssl.cpython-38-x86_64-linux-gnu.so)
    gcloud_main = _import_gcloud_main()
    import googlecloudsdk.gcloud_main
    from googlecloudsdk.calliope import base
    from googlecloudsdk.calliope import arg_parsers
    from googlecloudsdk.core import log
    from googlecloudsdk.core import properties
    from googlecloudsdk.core import config
    from oauth2client import client
    from oauth2client import transport
    import httplib2
    from httplib2.python3.httplib2 import *
    import ssl
    import _ssl             # if we can't import it, let the error propagate

This usually indicates corruption in your gcloud installation or problems with your Python interpreter.

Please verify that the following is the path to a working Python 2.7 or 3.5+ executable:
    /usr/bin/python3

If it is not, please set the CLOUDSDK_PYTHON environment variable to point to a working Python 2.7 or 3.5+ executable.

If you are still experiencing problems, please reinstall the Cloud SDK using the instructions here:
    https://cloud.google.com/sdk/
Traceback (most recent call last):
  File "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/bin/docker-credential-gcloud', 'get']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/auth.py", line 264, in _resolve_authconfig_credstore
  File "docker/credentials/store.py", line 35, in get
  File "docker/credentials/store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-gcloud exited with "".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
  File "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 356, in ensure_image_exists
  File "compose/service.py", line 1267, in pull
  File "compose/progress_stream.py", line 99, in get_digest_from_pull
  File "compose/service.py", line 1234, in _do_pull
  File "docker/api/image.py", line 396, in pull
  File "docker/auth.py", line 48, in get_config_header
  File "docker/auth.py", line 324, in resolve_authconfig
  File "docker/auth.py", line 235, in resolve_authconfig
  File "docker/auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-gcloud exited with "".')
[14339] Failed to execute script docker-compose

Run Code Online (Sandbox Code Playgroud)

老实说,我无法理解那里出了什么问题。我正在使用 Ubuntu 20.04 LTS。我的系统安装了 OpenSSL 1.1.1f。

Fil*_*vić 17

这解决了 Python 3 的问题:

export LD_LIBRARY_PATH=/usr/local/lib
Run Code Online (Sandbox Code Playgroud)

  • 这解决了我在 WSL2 上的问题 (3认同)
  • 它适用于 Ubuntu 20,4 (3认同)
  • 修复了 Ubuntu 21.10 上的问题 (2认同)

Nic*_*lta 16

所以,docker-compose 中存在一个问题,为这个问题提供了一些解决方案。似乎 Google Cloud SDK 更新破坏了 docker 团队发布的修复程序。这里给出的临时解决方案解决了我的问题:

export CLOUDSDK_PYTHON=python2
Run Code Online (Sandbox Code Playgroud)

  • 这也解决了我的问题!我正在将 WSL2 与 docker 一起使用,并尝试“docker-machine”拉取一些图像。 (2认同)