Closed mwisnicki closed 10 hours ago
Hi @mwisnicki, thanks for raising the issue. This documentation has been contributed by the Rancher Team and it is the same described in their own docs
@sunilarjun Can you help us, please?
Hello there @mwisnicki and @eddumelendez ! I have re-tested the QEMU steps using Rancher Desktop v1.15.0 and am able to successfully work through the example on macOS M1. Please note that administrative access must be enabled in RD to use QEMU.
@mwisnicki could you please elaborate on your Rancher Desktop version and administrative access enablement? Thank you for any info!
You're right. I didn't have administrator enabled since it causes other issues and Rancher recommends to avoid it. With admin rights I was able get success although there were a lot of exceptions logged related to ryuk
16:31:04.499 [main] INFO tc.testcontainers/ryuk:0.6.0 - Container testcontainers/ryuk:0.6.0 started in PT0.450284S
16:31:04.504 [testcontainers-ryuk] WARN org.testcontainers.utility.RyukResourceReaper - Can not connect to Ryuk at localhost:32768
java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:609)
at org.testcontainers.utility.RyukResourceReaper.lambda$null$1(RyukResourceReaper.java:105)
at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady(RateLimiter.java:27)
at org.testcontainers.utility.RyukResourceReaper.lambda$maybeStart$2(RyukResourceReaper.java:101)
at java.base/java.lang.Thread.run(Thread.java:829)
... repeat many times
16:31:06.811 [testcontainers-ryuk] DEBUG org.testcontainers.utility.ResourceReaper - Sending 'label=org.testcontainers%3Dtrue&label=org.testcontainers.lang%3Djava&label=org.testcontainers.version%3D1.19.4&label=org.testcontainers.sessionId%3D6a39f7da-182e-443b-a8dd-5313bc9c4fb3' to Ryuk
16:31:06.814 [testcontainers-ryuk] DEBUG org.testcontainers.utility.RyukResourceReaper - Received 'ACK' from Ryuk
I guess that normal?
Why can't testcontainer work without Rancher running as admin?
BTW I tried these steps and they seem to work without admin:
export DOCKER_HOST=unix://$HOME/.rd/docker.sock
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
git clone https://github.com/testcontainers/testcontainers-java-repro
cd testcontainers-java-repro
./mvnw verify
Success
Why can't testcontainer autodetect this? There is already some autodetection code that tries multiple options.
Also don't understand that socker override. Shouldn't it point to $HOME/.rd/docker.sock
?
Not sure what's going on here:
docker run -v $HOME/.rd/docker.sock:/var/run/docker.sock -e RYUK_PORT=8080 -p 8080:8080 docker.io/testcontainers/ryuk:0.6.0
2024/08/13 20:45:11 Pinging Docker...
panic: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
goroutine 1 [running]:
main.main()
/app/main.go:131 +0x410
but
docker run -v /var/run/docker.sock:/var/run/docker.sock -e RYUK_PORT=8080 -p 8080:8080 docker.io/testcontainers/ryuk:0.6.0
2024/08/13 20:45:20 Pinging Docker...
2024/08/13 20:45:20 Docker daemon is available!
2024/08/13 20:45:20 Starting on port 8080...
2024/08/13 20:45:20 Started!
Using VZ and adding
export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show vznat | awk '/inet / {sub("/.*",""); print $2}')
Fixes the exception logged.
@mwisnicki I am a bit unsure of the exception being seen but currently Rancher Desktop has a how-to guide on a non-admin path for using Testcontainers using VZ emulation, and admin paths for using Testcontainers using QEMU and VZ (RD latest
docs link here).
Closing as the existing docs is valid to use Testcontainers with Rancher Desktop.
Module
Core
Testcontainers version
N/A
Using the latest Testcontainers version?
Yes
Host OS
MacOS
Host Arch
ARM
Docker version
What happened?
Not related to java but website does not offer instructions how to report documentation bugs
Follow: https://java.testcontainers.org/supported_docker_environment/#rancher-desktop \ Using qemu
Relevant log output
No response
Additional Information
No response