投稿日:2020年8月26日
開発をしていたら、突然docker-composeでのbuildができなくなってしまいました。どうやら同じ問題で悩む方が結構いたみたいなので解決策をメモしておきます。
先日開発をしていると以下のようにdocker-composeでのbuildが突然できなくなってしまいました。ちなみにdockerのバージョンは19.03.12、docker-composeのバージョンは1.26.2です。
$ sudo docker-compose build
[sudo] password for ogihara:
pgadmin_app uses an image, skipping
Building front_main
ERROR: gcloud failed to load: /tmp/_MEIv2JAjl/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so)
gcloud_main = _import_gcloud_main()
import googlecloudsdk.gcloud_main
from googlecloudsdk.api_lib.iamcredentials import util as iamcred_util
from googlecloudsdk.api_lib.util import apis_internal
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 "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/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 "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-gcloud exited with "".
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bin/docker-compose", line 6, in <module>
File "compose/cli/main.py", line 72, in main
File "compose/cli/main.py", line 128, in perform_command
File "compose/cli/main.py", line 304, in build
File "compose/project.py", line 403, in build
File "compose/project.py", line 385, in build_service
File "compose/service.py", line 1106, 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 311, 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-gcloud exited with "".')
[11991] Failed to execute script docker-compose
エラー内容を詳しく見てみたのですが、思い当たる節が全くありません(汗)。
GCPも個人で使用はしていますが、このbuildの部分では関係はないはず...。
問題は設定ファイルにありました。
credHelpersのディレクティブに問題があるようです。
自分でこのような設定をいじった覚えはないのでOSのアップデートやソフトウェアのアップデートのタイミングで勝手にこのような設定がされてしまったのでしょうか。
{
"auths": {
"": {
"auth": "asdfasdfasdfasdfasdfasdfasdfasdffa"
},
"https://index.docker.io/v1/": {
"auth": "asdfasdfasdfasasdfasdfasdfasdfasdf"
}
},
"credHelpers": {
"gcr.io": "gcloud",
"us.gcr.io": "gcloud",
"eu.gcr.io": "gcloud",
"asia.gcr.io": "gcloud",
"staging-k8s.gcr.io": "gcloud",
"marketplace.gcr.io": "gcloud"
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.0 (linux)"
}
}
問題のcredHelperディレクティブを削除することで問題なく動く様になりました!
{
"auths": {
"": {
"auth": "asdfasdfasdfasdfasdfasdfasdfasdffa"
},
"https://index.docker.io/v1/": {
"auth": "asdfasdfasdfasasdfasdfasdfasdfasdf"
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.0 (linux)"
}
}
助かりました!!