-
-
Notifications
You must be signed in to change notification settings - Fork 515
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]: Docs state docker context aware, but does not seem to work #815
Comments
I had to run |
Hi @rcrowe did you have the chance to test this with latest v0.23.0? We did some efforts to improve the Docker host & socket path discovery in the recent releases. Could you post here your findings? |
@mdelapenya looks like it's still a problem with v0.23.0:
|
On 69b9fc4 it's even worse:
I think #1490 introduced a bug, I don't think swapping out the testcontainers-go/docker_client.go Line 43 in 69b9fc4
|
It looks like the |
@mdelapenya I can confirm it's still not working as advertised without the symlink workaround when testing against |
@benmoss #815 (comment) this was already solved in @rcrowe I need to properly setup my machine to use colima to test this, but I need to create room for working on other container runtimes, although not sure when 😞 . If you think updating the docs with the symlink workround is enough, please let's change it in the docs. |
Can confirm this is still not working on v0.25. The only workaround is:
|
So I think we can actively add that to the docs, right? Is anybody interested in the contribution? |
Oops, I was mistaken. But sshfs that colima VM uses doesn't seem to handle mounted sockets from host correctly (the other two, virtiofs and p9, don't even support stat syscall on sockets, so can't even mount sockets with them), and because testcontainers mounts the host docker socket to the reaper container, using custom docker host is not possible. Reaper container will have to use the default docker socket in the colima VM, which is not mounted from host machine, to function. Tested with colima v0.6.6. So linking the docker socket to the default path is the only possible way for reaper to work. If disable reaper, |
on darwin. However, I had to use sshfs which is the only filesystem that supports mounted sockets with the following command: `colima start --arch aarch64 --vm-type=vz --vz-rosetta --cpu 8 \ --memory 8 --mount-type sshfs rosetta` and link the colima socket to `/var/run/docker.sock` as explained in [1] with: `sudo ln -sf $HOME/.colima/rosetta/docker.sock /var/run/docker.sock`. [1]: testcontainers/testcontainers-go#815 (comment)
Hi folks, could any of you update the docs for Colima? I'd need to create a local environment, which is something I cannot do at the moment, so I'd appreciate your assistance here 🙏 |
@mdelapenya Try |
I had been facing similar issues. Turned out, I was looking at the wrong documentation. On checking documentation for Java, I found colima had to be started with flag sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
colima stop
colima start --network-address
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
export TESTCONTAINERS_HOST_OVERRIDE=$(colima ls -j | jq -r '.address')
export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock" I've tried running the example code, and the errors have been fixed. Hope this helps! Edit: Missed adding the relevant link |
I followed #815 (comment) and I was able to step colima and run some of the project tests. I'm going to update the colima docs to include them Thanks! |
@mdelapenya I don't think https://github.com/testcontainers/testcontainers-go/pull/2578/files fixes the problem as docs state
while it does seem one still need to link colima socket with sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock (this is on colima version 0.6.9 and testcontainers v0.32.0) |
Testcontainers version
v0.17.0
Using the latest Testcontainers version?
Yes
Host OS
OSX
Host arch
Arm64
Go version
1.19
Docker version
Docker info
What happened?
Starting a container via testcontainers returns the following error:
Relevant log output
No response
Additional information
states the following:
testcontainers-go/docs/system_requirements/using_colima.md
Lines 6 to 8 in ba569c0
The context is set correctly...
I can work work around that, but based on the docs assumed this was supposed to work.
If testcontainers is not context aware, I guess this is a feature request & not a bug report 😄
The text was updated successfully, but these errors were encountered: