ubuntu - docker-compose 不使用 gcloud : Cannot Find OpenSSL

标签 ubuntu docker-compose gcloud

在 gcloud CLI 中按照 Artifact Registry 的设置说明进行操作后,每当我使用 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

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

最佳答案

这解决了 Python 3 的问题:

export LD_LIBRARY_PATH=/usr/local/lib
这个upstream comment有详细的解释关于为什么解决了LD_LIBRARY_PATH是不正确的,需要改变。

关于ubuntu - docker-compose 不使用 gcloud : Cannot Find OpenSSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65295958/

相关文章:

git - Gcloud 无法与 git 一起使用

ubuntu - 在 Ubuntu 12.04 上将 Vim 更新到最新版本

apache - 如何管理安装到 docker 容器中的卷的权限?

azure - Azure上的Docker compose webapp无法访问

google-app-engine - 查看将部署到 Google AppEngine 的文件

python - Google Cloud Platform 配额监控(警报)

ubuntu - 使用 dpkg 为 systemd 和 upstart 配置打包

python - 通过 Python 发送电子邮件的最简单方法

ubuntu - 尝试编译 'make' 自定义配置 vim 将不起作用

django - 如何打开 postgres 数据库并查看表(Django+Postgres+Docker)