-
Notifications
You must be signed in to change notification settings - Fork 35
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
Cannot connect to the Docker daemon ($DOCKER_HOST - non typical docker.sock location - no root permission ) #161
Comments
On my docker host the dock.sock (DOCKER ENDPOINT) is at $DOCKER_HOST (unix://$HOME/.colima/default/docker.sock). Anyone can help? |
|
Hi @jpmartins I guess you already took a look at https://golang.testcontainers.org/system_requirements/using_colima/ Did you follow the steps in that guide? |
Thanks for you input mdelapenya. That guide, on the "other applications that are unaware of Docker context the following workaround" requires something I do not have permission to do, this is a work macbook and on it I do not have a way to do:
It would be nice to have other alternatives... currently my workaround is using docker desktop instead of colima. |
By the way, some of the instructions I identified what seem to be issues that I could not figure out how to fix. More specifically the TESTCONTAINERS_HOST_OVERRIDE initialisation is returning null:
|
Suspect some of the issues might be related with running colima emulating x86_64 under a arm64 cpu. |
Hi @jpmartins, why are you running Ryuk manually using the Docker CLI? Testcontainers tries to configure the socket location provided to Ryuk depending on your environment. If this is not working, you should open the issue on the Testcontainers side. When running Ryuk manually (which is not something Testcontainers users need to do, this is only relevant for Testcontainers developers), you need to mount the socket as per README:
So, if this is a Testcontainers issue, let's please close this issue here and instead open it in the corresponding Testcontainers language project. |
I had a ticket on testcontainers... I closed it and opened this one since the error is on starting the ryuk container... calling it directly has the goal to try to replicate the issue by the command line outside testcontainers. To try to show, that from my perspective there are issues on ryuk side. Are you saying only a ticket on testcontainers-java side can troubleshoot this? Since I have limited permissions, it is not possible to have default/standard location of docker.sock on my machine, so /var/run/docker.sock does not exist on my machine, and I do not have admin or sudo rights to create it. That is why I pointed to the existing /Users/_user/.docker/run/docker.sock while starting the ryuk. For documentation proposes on issues with start ryuk, if your docker-desktop on arm64 suddenly stops working with:
Following the docker/for-mac#4859 (comment), and changing to "osxfs (Legacy)" in the Advanced Docker Destkop worked for my case. |
The important thing here is, that we don;t start to mix Testcontainers features into this issue then if we want to specifically debug running Ryuk (like In your case, I guess you would need to run Ryuk like this (I didn't see you doing it in your previous posts), although I am entirely not sure how to indicate to Colima, to mount the socket from within the Colima VM instead of mounting through the host (also see abiosoft/colima#688 (comment)):
Using Docker Desktop is the officially supported runtime by Testcontainers, we don't officially support other container runtimes and it is up to users configure things in a way to work similar to Docker Desktop.
Since it seems your goal is about running testcontainers-java, and not about manually running Ryuk, yes, the correct approach is go through testcontainers-java. |
You were right, sorry for the inconvenience, hope you have a nice weekend, and thank you for the help on Slack. As you now know Kevin, with -v /var/run/docker.sock:/var/run/docker.sock alone did not cut it, the issue was also some leftover environment variables from my first attempt with colima, the DOCKER_HOST env var was set to point to docker.sock of Docker-Desktop. DOCKER_HOST should not be set for Docker-Desktop. Temporary disable of ryuk is an option to continue exploring/learning, but will have the test container not being discarded that way. Thank you very much. |
Hello I am having error starting the testcontainers/ryuk on my docker daemon
The text was updated successfully, but these errors were encountered: