Couldn't connect to Docker daemon at https

Hi there,

I know this question was asked at least a couple of times in the past, but none of the answers I saw really fitted my problem.

As the subject says, I get the Couldn’t connect to Docker daemon message when invoking docker-compose command. I have the following executor and config:

executors:
    docker-publisher:
        docker:
            -   image: circleci/php:7.4-node-browsers
            -   image: circleci/postgres:12-postgis-ram
                environment:
                    POSTGRES_PASSWORD: ci

And then I use that executor:

build_and_test:
    executor: docker-publisher

    steps:
        - checkout
        - setup_remote_docker
        -   run:
                name: Running docker-compose build
                command: docker-compose -f .docker/docker-compose.yml -f .docker/docker-compose.ci.yml --env-file .docker/.env build

And then, when running, I get:

Setup remote docker engine:

Created container accessible with:
  DOCKER_CERT_PATH=/tmp/docker-certs051493607
  DOCKER_HOST=tcp://35.232.179.125:2376
  DOCKER_MACHINE_NAME=215303954
  DOCKER_TLS_VERIFY=1
  NO_PROXY=127.0.0.1,localhost,circleci-internal-outer-build-agent,35.232.179.125:2376

Failing Job step:

#!/bin/bash -eo pipefail docker-compose -f .docker/docker-compose.yml -f .docker/docker-compose.ci.yml --env-file .docker/.env build

postgres uses an image, skipping 
Building PHP 
ERROR: Couldn't connect to Docker daemon at https://35.232.179.125:2376 - is it running?

So, I guess, the docker host/port does seem right, doesn’t it?

The weird part is that I literally copied the config from another project at CircleCI, which does not show any errrors :slight_smile:

Does anyone have any ideas?

Appreciate the help :slight_smile:

Anybody? :slight_smile:

Miraculously, now it passes without issue. Closing the topic :slight_smile:

Just to post a follow-up, if anyone stumbles upon this:

In my docker-compose step I had an environment section with one value BUILD_TAG. With this section in place, my job would fail with the above error. As soon as I remove this, it passes without any issue.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.