Run docker-compose results in dial tcp 164.92.229.23:2375: i/o timeout

Hello, I have a problem that I can’t solve.

% mate .env
% mate docker-compose.yaml
% docker-compose up -d

leads to:

Get "http://164.92.229.23:2375/v1.24/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C %22com.docker.compose.project%3Dlocal-demo%22%3Atrue%7D%7D": dial tcp 164.92.229.23:2375: i/o timeout

Whois for the IP 164.92.229.23 shows Digital Ocean.

% docker -v
Docker version 20.10.24, build 297e128

% docker-compose -v
Docker Compose version v2.17.2

macOS Monterey (12.6.5) Apple silicon

docker-compose.yaml

version: '3.5'

services:
  server:
    image: cortezaproject/corteza:${VERSION}
    restart: always
    env_file: [ .env ]
    depends_on: [ db ]
    ports: [ "127.0.0.1:18080:80" ]

  db:
    # MySQL Database
    # See https://hub.docker.com/r/percona/percona-server for details
    image: percona:8.0
    restart: always
    environment:
      MYSQL_DATABASE: dbname
      MYSQL_USER:     dbuser
      MYSQL_PASSWORD: dbpass
      # get the random generated password by running: docker-compose logs db | grep "GENERATED ROOT PASSWORD"
      MYSQL_RANDOM_ROOT_PASSWORD: random
    healthcheck: { test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"], timeout: 20s, retries: 10 }

If you want faster help, please, format your post properly next time and check it after posting it to make sure it looks like you wanted it to be. Otherwise pleople will walk away since they don’t want to work on understanding the question and they can’t fix your post as moderators. I fixed it for you now, but I can just hope I used code blocks correctly on your shared text…

Port 2375 is the port of the TCP socket of Docker. Where do you run the project? I used Digital Ocean but only a droplet on which I installed Docker so I didn’t have any remote socket.

You mentioned macOS in your message, so I guess you run the compose on your local machine in Docker Desktop for Mac. Then make sure your docker context is correct. If you want to use the local docker daemon, then you need the “desktop-linux” context or the “default” if that points to “desktop-linux” too.

docker context ls
docker context use desktop-linux

Hello Ákos, thank you very much for your help.

I did as you said

% docker context ls
NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT                                   KUBERNETES ENDPOINT   ORCHESTRATOR
default *           moby                Current DOCKER_HOST based configuration   tcp://164.92.229.23:2375                                                swarm
desktop-linux       moby                                                          unix:///Users/romangrom/.docker/run/docker.sock

an then:

% docker context use desktop-linux

Current context is now "desktop-linux"
Warning: DOCKER_HOST environment variable overrides the active context. To use "desktop-linux", either set the global --context flag, or unset DOCKER_HOST environment variable.

Then the envar adjusted …

% printenv | grep docker
DOCKER_HOST=tcp://docker-user@164.92.229.23:2375

% nano .zshrc
export DOCKER_HOST=unix:///Users/romangrom/.docker/run/docker.sock

Then checked whether it was switched or not.

% docker context ls
NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT                                   KUBERNETES ENDPOINT   ORCHESTRATOR
default *           moby                Current DOCKER_HOST based configuration   tcp://164.92.229.23:2375                                                swarm
desktop-linux       moby                                                          unix:///Users/romangrom/.docker/run/docker.sock

Unfortunately it does not work. I interpret * as a marker for default.

Fortunately, DOCKER_HOST overrides this setting, doesn’t it? I’ll try that out…

% docker-compose up -d
[+] Running 1/19
 ⠹ server 4 layers [⣷⣄⣿⠀] 35.73MB/134.2MB Pulling                                                                                  20.2s
   ⠦ 06d39c85623a Downloading [=============================================>     ]  25.07MB/27.5MB                                12.6s
   ⠦ ecc6eeffae77 Downloading [=======================>                           ]  3.179MB/6.709MB

.. and so on ..

That looks good, that looks really good! Thanks very much!

The Corteza low code apparently does not support Apple silicon belongs in another forum…

So now check if I formatted everything correctly …

Did you also open a new zsh terminal to apply the changes in your current terminal session? I would also remove the DOCKER_HOST variable completely.

That is actually not “default” but “current” or “active”

Yes, but it was the original problem so I would not rely on that. I have a gist that can help you open a terminal session specifically for Docker Desktop or Rancher Desktop

This is the related part of the video in which I talked about it: https://www.youtube.com/watch?v=jaj5OCFQHxU&t=462s at 7:42.

It will not override the DOCKER_HOST variable, but you can easily add the following line to the script to unset it

unset DOCKER_HOST

I “adopted” your gist. Thanks a lot for this.

Ákos, you really helped me a lot.

Thanks a lot for this,
Roman