question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: DOCKER_HOST unix:///var/run/docker.sock is not listening

See original GitHub issue

Module

Core

Testcontainers version

1.17.5

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host Arch

x86

Docker version

Client: Docker Engine - Community
 Cloud integration: v1.0.29
 Version:           20.10.21
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        baeda1f
 Built:             Tue Oct 25 18:01:58 2022
 OS/Arch:           linux/amd64
 Context:           desktop-linux
 Experimental:      true

Server: Docker Desktop 4.14.0 (91374)
 Engine:
  Version:          20.10.21
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       3056208
  Built:            Tue Oct 25 18:00:19 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.9
  GitCommit:        1c90a442489720eec95342e1789ee8a5e1b9536f
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

What happened?

I’m getting this error DOCKER_HOST unix:///var/run/docker.sock is not listening whenever I try to run the tests. I can run normal docker commands like docker ps and docker-compose up without any issue. I also checked /var/run/docker.sock and it exists:

ls -la /var/run/ | grep docker
srw-rw----  1 root     docker        0 лис 11 10:03 docker.sock

Relevant log output

2022-11-11T13:13:16.828GMT+02:00 INFO  o.t.d.DockerClientProviderStrategy  Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2022-11-11T13:13:16.856GMT+02:00 WARN  o.t.d.DockerClientProviderStrategy  DOCKER_HOST unix:///var/run/docker.sock is not listening
2022-11-11T13:13:16.863GMT+02:00 INFO  o.t.d.DockerMachineClientProviderStrategy  docker-machine executable was not found on PATH ([/home/serg/.sdkman/candidates/scala/current/bin, /home/serg/.sdkman/candidates/sbt/current/bin, /home/serg/.sdkman/candidates/java/current/bin, /home/serg/anaconda3/bin, /home/serg/anaconda3/condabin, /home/serg/.cargo/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /snap/bin, /home/serg/.local/bin, /home/serg/cqlsh-6.8.5/bin, /home/serg/app/terraform, /home/serg/app/Obsidian, /home/serg/app/deadbeef-1.8.7, /home/serg/app, /home/serg/.cache/scalacli/local-repo/bin/scala-cli, /home/serg/docker_compose])
2022-11-11T13:13:16.864GMT+02:00 ERROR o.t.d.DockerClientProviderStrategy  Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
As no valid configuration was found, execution cannot continue.

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sergedacommented, Nov 12, 2022

Thanks a lot @gesellix Those commands helped a lot 👍

0reactions
gesellixcommented, Nov 13, 2022

Thanks @sergeda. So this looks indeed like the issues at #6076 and https://github.com/docker/for-mac/issues/6529.

Read more comments on GitHub >

github_iconTop Results From Across the Web

linux - Cannot connect to the Docker daemon at unix:/var/run ...
It worked fine for me. P.S.: after if there is commands that you can't do without sudo, try this: gpasswd -a $USER docker....
Read more >
[FIX] Cannot Connect to the Docker Daemon at 'unix:///var/run ...
One of the most common arising error is: Cannot connect to the Docker daemon at (unix:///var/run/docker.sock. Is the docker daemon running?)
Read more >
How to set DOCKER_HOST on 4.13.0 without /var/run/docker ...
I use Docker Desktop along with other tools that require DOCKER_HOST . The docs say to set this to the /var/run/docker.sock ...
Read more >
Cannot Connect to a Docker Daemon - Baeldung
We looked into various ways to solve this issue by adding the user into the docker group and changing the permission of the...
Read more >
How to Resolve the “cannot connect to the Docker daemon ...
Method 2: Assign Ownership to the Docker Unix Socket. The “cannot connect to the Docker daemon” error also happens if the Unix socket...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found