8000 Symfony not detecting my docker containers · Issue #518 · symfony-cli/symfony-cli · GitHub
[go: up one dir, main page]

Skip to content

Symfony not detecting my docker containers #518

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

Closed
pmishev opened this issue Oct 4, 2024 · 5 comments · Fixed by #520
Closed

Symfony not detecting my docker containers #518

pmishev opened this issue Oct 4, 2024 · 5 comments · Fixed by #520

Comments

@pmishev
Copy link
pmishev commented Oct 4, 2024

I have docker running with several containers using docker compose, however none of them show in the Symfony toolbar:
image

Also running symfony var:export --debug --multiline doesn't list any docker containers, nor env variables that should have been set by docker.

Maybe the issue is docker-side, but I have no idea how to further diagnose the problem.
I'm running Docker Desktop.
/opt/docker-desktop/bin/com.docker.diagnose check shows no fatal errors

$ docker version
Client: Docker Engine - Community
 Version:           27.3.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        ce12230
 Built:             Fri Sep 20 11:41:00 2024
 OS/Arch:           linux/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.34.2 (167172)
 Engine:
  Version:          27.2.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.21.13
  Git commit:       3ab5c7d
  Built:            Tue Aug 27 14:15:15 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.20
  GitCommit:        8fc6bcff51318944179630522a095cc9dbf9f353
 runc:
  Version:          1.1.13
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
@Kocal
Copy link
Contributor
Kocal commented Oct 4, 2024

Could it be related to #285 (DOCKER_HOST env var issue)?

@pmishev
Copy link
Author
pmishev commented Oct 4, 2024

Indeed it was, thank you!

Adding export DOCKER_HOST=unix://$HOME/.docker/desktop/docker.sock in my .bashrc fixed the problem.
There should really be at least some indication of the problem, like an error message that docker.sock is not found when you run symfony var:export --debug maybe with a suggestion why.

@tucksaun
Copy link
Member
tucksaun commented Oct 5, 2024

The socket detection path is not part of the Symfony CLI code but directly Docker's one. I'll see what we can do but as stated previously, Docker explicitly says that in such case one has to export DOCKER_HOST so I'm not sure I can do it so easily 😕

Regarding the --debug flag: the debug information are already showed when one using the -vvv flag, but it's true this flag documentation is mentioning "Debug Docker support" so I'll look into it.

@tucksaun
Copy link
Member
tucksaun commented Oct 5, 2024

See #519 for connection error logging

@tucksaun
Copy link
Member
tucksaun commented Oct 5, 2024

See #520 for a fix attempt

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

Successfully merging a pull request may close this issue.

3 participants
0