前提・実現したいこと
・docker-compose buildでイメージを再構築させたい。
発生している問題・エラーメッセージ
・docker-compose.yamlでdocker-compose buildを叩くと、エラーが出るが、エラーの原因と解決策が分からない。
足りない情報がありましたら更新致しますので、ご指摘頂けるとありがたいです。
ConnectionRefusedError: [Errno 61] Connection refused
ProtocolError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
該当のソースコード
$ docker-compose build Traceback (most recent call last): File "site-packages/urllib3/connectionpool.py", line 677, in urlopen File "site-packages/urllib3/connectionpool.py", line 392, in _make_request File "http/client.py", line 1252, in request File "http/client.py", line 1298, in _send_request File "http/client.py", line 1247, in endheaders File "http/client.py", line 1026, in _send_output File "http/client.py", line 966, in send File "site-packages/docker/transport/unixconn.py", line 43, in connect ConnectionRefusedError: [Errno 61] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "site-packages/requests/adapters.py", line 449, in send File "site-packages/urllib3/connectionpool.py", line 727, in urlopen File "site-packages/urllib3/util/retry.py", line 403, in increment File "site-packages/urllib3/packages/six.py", line 734, in reraise File "site-packages/urllib3/connectionpool.py", line 677, in urlopen File "site-packages/urllib3/connectionpool.py", line 392, in _make_request File "http/client.py", line 1252, in request File "http/client.py", line 1298, in _send_request File "http/client.py", line 1247, in endheaders File "http/client.py", line 1026, in _send_output File "http/client.py", line 966, in send File "site-packages/docker/transport/unixconn.py", line 43, in connect urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "site-packages/docker/api/client.py", line 205, in _retrieve_server_version File "site-packages/docker/api/daemon.py", line 181, in version File "site-packages/docker/utils/decorators.py", line 46, in inner File "site-packages/docker/api/client.py", line 228, in _get File "site-packages/requests/sessions.py", line 543, in get File "site-packages/requests/sessions.py", line 530, in request File "site-packages/requests/sessions.py", line 643, in send File "site-packages/requests/adapters.py", line 498, in send requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "docker-compose", line 3, in <module> File "compose/cli/main.py", line 67, in main File "compose/cli/main.py", line 123, in perform_command File "compose/cli/command.py", line 69, in project_from_options File "compose/cli/command.py", line 132, in get_project File "compose/cli/docker_client.py", line 43, in get_client File "compose/cli/docker_client.py", line 170, in docker_client File "site-packages/docker/api/client.py", line 188, in __init__ File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused')) [53665] Failed to execute script docker-compose
docker-compose.yml
version: '3' services: php: container_name: php build: ./docker/php volumes: - ./server:/var/www nginx: image: nginx container_name: nginx ports: - 80:80 volumes: - ./server:/var/www - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf depends_on: - php db: image: mysql:5.7 container_name: db-host environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: database MYSQL_USER: docker MYSQL_PASSWORD: docker TZ: 'Asia/Tokyo' command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci volumes: - ./docker/db/data:/var/lib/mysql - ./docker/db/my.cnf:/etc/mysql/conf.d/my.cnf - ./docker/db/sql:/docker-entrypoint-initdb.d ports: - 3306:3306
試したこと
・下記サイトでエラーについて調べてみた
https://stackoverflow.com/questions/64662372/docker-compose-up-error-while-fetching-server-api-version-connection-aborte
補足情報(FW/ツールのバージョンなど)
あなたの回答
tips
プレビュー