testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

TestContainers not working with Rancher Desktop

Open mcekovic opened this issue 4 years ago • 27 comments

Given the license change for Docker Desktop, everybody is searching for the alternatives. Docker installed on WSL2 works nicely with TestConteiners for me (after exposing 2375 port), but cannot make Rancher Desktop working. Rancher Desktop in the latest 0.7 version introduced option to use dockerd (moby) as container runtime, all with 'standard' Docker API exposed. TestConteiners are able to find DockerAPI within Rancher Desktop (0.7+), however for some reason TestContainer checks hang:

14:42:15.044 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000A: preparing request execution
14:42:15.044 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.protocol.RequestAddCookies - Cookie spec selected: strict
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.protocol.RequestAuthCache - Auth cache not set in the context
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000A: target auth state: UNCHALLENGED
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000A: proxy auth state: UNCHALLENGED
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000A: acquiring connection with route {}->npipe://localhost:2375
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000A: acquiring endpoint (3 MINUTES)
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000A: endpoint lease request (3 MINUTES) [route: {}->npipe://localhost:2375][total available: 1; route allocated: 1 of 2147483647; total allocated: 1 of 2147483647]
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000A: endpoint leased [route: {}->npipe://localhost:2375][total available: 0; route allocated: 1 of 2147483647; total allocated: 1 of 2147483647]
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000A: acquired ep-00000009
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000A: acquired endpoint ep-00000009
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000A: executing POST /v1.32/exec/829f47a2e65220db1ead02666338ce2504115d29b15cb0dfb01fb6c64c2c3273/start HTTP/1.1
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-00000009: start execution ex-0000000A
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-00000009: executing exchange ex-0000000A over http-outgoing-1
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> POST /v1.32/exec/829f47a2e65220db1ead02666338ce2504115d29b15cb0dfb01fb6c64c2c3273/start HTTP/1.1
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> accept: application/json
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> content-type: application/json
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Accept-Encoding: gzip, x-gzip, deflate
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Content-Length: 26
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Host: localhost:2375
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Connection: keep-alive
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> User-Agent: Apache-HttpClient/5.0.3 (Java/17.0.1)
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "POST /v1.32/exec/829f47a2e65220db1ead02666338ce2504115d29b15cb0dfb01fb6c64c2c3273/start HTTP/1.1[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "accept: application/json[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "content-type: application/json[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Accept-Encoding: gzip, x-gzip, deflate[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Content-Length: 26[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Host: localhost:2375[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Connection: keep-alive[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "User-Agent: Apache-HttpClient/5.0.3 (Java/17.0.1)[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "[\r][\n]"
14:42:15.045 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "{"Detach":null,"Tty":null}"
14:42:15.046 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "HTTP/1.1 200 OK[\r][\n]"
14:42:15.046 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Api-Version: 1.41[\r][\n]"
14:42:15.046 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Content-Type: application/vnd.docker.raw-stream[\r][\n]"
14:42:15.046 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Docker-Experimental: false[\r][\n]"
14:42:15.046 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Ostype: linux[\r][\n]"
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Server: Docker/20.10.11 (linux)[\r][\n]"
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Date: Mon, 20 Dec 2021 13:42:15 GMT[\r][\n]"
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Transfer-Encoding: chunked[\r][\n]"
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << HTTP/1.1 200 OK
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Api-Version: 1.41
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Content-Type: application/vnd.docker.raw-stream
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Docker-Experimental: false
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Ostype: linux
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Server: Docker/20.10.11 (linux)
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Date: Mon, 20 Dec 2021 13:42:15 GMT
14:42:15.047 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Transfer-Encoding: chunked
14:42:15.048 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000A: connection can be kept alive for 3 MINUTES
14:42:15.161 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "40c[\r][\n]"
14:42:15.162 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[0x1][0x0][0x0][0x0][0x0][0x0][0x4][0x4]Filesystem           1024-blocks    Used Available Capacity Mounted on[\n]"
14:42:15.162 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "overlay              263174212    864228 248871828   0% /[\n]"
14:42:15.162 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "tmpfs                    65536         0     65536   0% /dev[\n]"
14:42:15.162 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "tmpfs                  6502652         0   6502652   0% /sys/fs/cgroup[\n]"
14:42:15.162 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "/dev/sdd             263174212    864228 248871828   0% /etc/resolv.conf[\n]"
14:42:15.162 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "/dev/sdd             263174212    864228 248871828   0% /etc/hostname[\n]"
14:42:15.162 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "/dev/sdd             263174212    864228 248871828   0% /etc/hosts[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "shm                      65536         0     65536   0% /dev/shm[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "none                   6502652       960   6501692   0% /run/docker.sock[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "tmpfs                  6502652         0   6502652   0% /proc/acpi[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "tmpfs                    65536         0     65536   0% /proc/kcore[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "tmpfs                    65536         0     65536   0% /proc/keys[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "tmpfs                    65536         0     65536   0% /proc/timer_list[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "tmpfs                    65536         0     65536   0% /proc/sched_debug[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "tmpfs                  6502652         0   6502652   0% /sys/firmware[\n]"
14:42:15.163 [docker-java-stream-1961497227] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"

Tried also disabling TestContainers checks with checks.disable=true, that way target image gets loaded, but TestContainers fails on waiting for the test container to start by waiting for exposed ports to be available (I was using plain redis image for the test).

mcekovic avatar Dec 20 '21 13:12 mcekovic

The same issue can be reproduced on Rancher Desktop 1.2.1 + Windows 10, with this sample project https://github.com/lreimer/hands-on-testcontainers.git

pidzama avatar Apr 08 '22 12:04 pidzama

@kiview was this on M1 arm64 architecture? I must admit I'm having issues

Krijger avatar Apr 26 '22 15:04 Krijger

@edeandrea would need to answer this.

kiview avatar Apr 26 '22 15:04 kiview

No it was intel

edeandrea avatar Apr 26 '22 20:04 edeandrea

@edeandrea thanks. I had a different issue, and it was fixed by fixing my JNA dependency according to https://github.com/testcontainers/testcontainers-java/issues/3834 . Now I need to see how to run the MS SQL tests :)

Krijger avatar Apr 28 '22 17:04 Krijger

For future reference, I found this related upstream issue at Rancher: https://github.com/rancher-sandbox/rancher-desktop/issues/2609

kiview avatar Sep 12 '22 13:09 kiview

There is Rancher Desktop section that has been added about how to set up Testcontainers.

eddumelendez avatar Sep 28 '23 16:09 eddumelendez