Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sergeda opened this issue Nov 11, 2022 · 5 comments
Closed

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

sergeda opened this issue Nov 11, 2022 · 5 comments
Labels

Comments

@sergeda
Copy link

sergeda commented Nov 11, 2022

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

@gesellix
Copy link
Contributor

Can you try the following commands?

  • check connectivity via docker.sock: curl --unix /var/run/docker.sock http://localhost/_ping
  • show the active Docker Context: docker context ls

@sergeda
Copy link
Author

sergeda commented Nov 12, 2022

Thanks a lot @gesellix Those commands helped a lot 👍

@sergeda sergeda closed this as completed Nov 12, 2022
@gesellix
Copy link
Contributor

I'm curious, can you tell a bit more what the issue was?

@sergeda
Copy link
Author

sergeda commented Nov 13, 2022

@gesellix Turn out that my docker.sock located not in the /var/run/docker.sock but in my home folder for some reason. I pointed testcontainers to that file and this error gone. Thank you

@gesellix
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants