testcontainers / testcontainers/testcontainers-java
[Bug]: On the fly image cannot be pulled from localhost registry
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
Module
Elasticsearch
Testcontainers version
1.18.3
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host Arch
x86
Docker version
Client:
Cloud integration: v1.0.35
Version: 24.0.2
API version: 1.43
Go version: go1.20.4
Git commit: cb74dfc
Built: Thu May 25 21:53:15 2023
OS/Arch: windows/amd64
Context: default
Server: Docker Desktop 4.21.0 (113844)
Engine:
Version: 24.0.2
API version: 1.43 (minimum version 1.12)
Go version: go1.20.4
Git commit: 659604f
Built: Thu May 25 21:52:17 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.21
GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc:
Version: 1.1.7
GitCommit: v1.1.7-0-g860f061
docker-init:
Version: 0.19.0
GitCommit: de40ad0
What happened?
I am trying to pass an on-the-fly image to an ElasticSearchContainer constructor. I don't know if it is related to ElasticSearch because the error message seems unrelated to the container type, but it works with other images. Anyway, this is the code:
new ElasticsearchContainer(DockerImageName.parse(new ImageFromDockerfile()
.withDockerfileFromBuilder(builder ->
builder
.from(ELASTICSEARCH_IMAGE)
// ...
.build()).getDockerImageName())
.asCompatibleSubstituteFor("docker.elastic.co/elasticsearch/elasticsearch"))
The Dockerfile that Testcontainer logs can be correctly built with docker build, but Testcontainer does not locally build it, and does not even log any error message. Obviously, when it tries to pull the new image from the local registry, it fails because it does not exist. Below the logs
Relevant log output
18:40:30.193 [main] INFO tc.testcontainers/ryuk:0.5.1 - Container testcontainers/ryuk:0.5.1 started in PT3.7773853S
18:40:30.198 [testcontainers-ryuk] DEBUG org.testcontainers.utility.ResourceReaper - Sending 'label=org.testcontainers%3Dtrue&label=org.testcontainers.lang%3Djava&label=org.testcontainers.version%3D1.18.3&label=org.testcontainers.sessionId%3D8a867fb7-ec17-4f40-a2a1-c56204041ac3' to Ryuk
18:40:30.201 [testcontainers-ryuk] DEBUG org.testcontainers.utility.RyukResourceReaper - Received 'ACK' from Ryuk
18:40:30.201 [main] INFO org.testcontainers.utility.RyukResourceReaper - Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
18:40:30.201 [main] DEBUG org.testcontainers.DockerClientFactory - Checks are enabled
18:40:30.201 [main] INFO org.testcontainers.DockerClientFactory - Checking the system...
18:40:30.201 [main] INFO org.testcontainers.DockerClientFactory - ✔︎ Docker server version should be at least 1.6.0
18:40:30.202 [main] DEBUG org.testcontainers.utility.PrefixingImageNameSubstitutor - No prefix is configured
18:40:30.202 [main] DEBUG org.testcontainers.utility.ImageNameSubstitutor - Did not find a substitute image for localhost/testcontainers/zd8uyc5sbgr3wjyh:latest (using image substitutor: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor'))
18:40:30.202 [main] DEBUG tc.localhost/testcontainers/zd8uyc5sbgr3wjyh:latest - localhost/testcontainers/zd8uyc5sbgr3wjyh:latest is not in image name cache, updating...
18:40:30.202 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: localhost/testcontainers/zd8uyc5sbgr3wjyh:latest
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000A: preparing request execution
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.protocol.RequestAddCookies - Cookie spec selected: strict
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.protocol.RequestAuthCache - Auth cache not set in the context
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000A: target auth state: UNCHALLENGED
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000A: proxy auth state: UNCHALLENGED
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000A: acquiring connection with route {}->npipe://localhost:2375
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000A: acquiring endpoint (3 MINUTES)
18:40:30.203 [main] 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: 0; route allocated: 0 of 2147483647; total allocated: 0 of 2147483647]
18:40:30.203 [main] 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]
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000A: acquired ep-00000009
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000A: acquired endpoint ep-00000009
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000A: opening connection {}->npipe://localhost:2375
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-00000009: connecting endpoint (3 MINUTES)
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-00000009: connecting endpoint to npipe://localhost:2375 (3 MINUTES)
18:40:30.203 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - http-outgoing-1: connecting to localhost/127.0.0.1:2375
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - http-outgoing-1: connection established
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-00000009: connected http-outgoing-1
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-00000009: endpoint connected
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000A: executing GET /v1.32/images/localhost%2Ftestcontainers%2Fzd8uyc5sbgr3wjyh:latest/json HTTP/1.1
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-00000009: start execution ex-0000000A
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-00000009: executing exchange ex-0000000A over http-outgoing-1
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> GET /v1.32/images/localhost%2Ftestcontainers%2Fzd8uyc5sbgr3wjyh:latest/json HTTP/1.1
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> accept: application/json
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> x-tc-sid: 8a867fb7-ec17-4f40-a2a1-c56204041ac3
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Accept-Encoding: gzip, x-gzip, deflate
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Host: localhost:2375
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Connection: keep-alive
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> User-Agent: Apache-HttpClient/5.0.3 (Java/17)
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "GET /v1.32/images/localhost%2Ftestcontainers%2Fzd8uyc5sbgr3wjyh:latest/json HTTP/1.1[\r][\n]"
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "accept: application/json[\r][\n]"
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "x-tc-sid: 8a867fb7-ec17-4f40-a2a1-c56204041ac3[\r][\n]"
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Accept-Encoding: gzip, x-gzip, deflate[\r][\n]"
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Host: localhost:2375[\r][\n]"
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Connection: keep-alive[\r][\n]"
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "User-Agent: Apache-HttpClient/5.0.3 (Java/17)[\r][\n]"
18:40:30.204 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "HTTP/1.1 404 Not Found[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Api-Version: 1.43[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Content-Type: application/json[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Date: Fri, 18 Aug 2023 16:40:30 GMT[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Docker-Experimental: false[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Ostype: linux[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Server: Docker/24.0.2 (linux)[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Transfer-Encoding: chunked[\r][\n]"
18:40:30.206 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << HTTP/1.1 404 Not Found
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Api-Version: 1.43
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Content-Type: application/json
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Date: Fri, 18 Aug 2023 16:40:30 GMT
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Docker-Experimental: false
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Ostype: linux
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Server: Docker/24.0.2 (linux)
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Transfer-Encoding: chunked
18:40:30.207 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000A: connection can be kept alive for 3 MINUTES
18:40:30.210 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "4e[\r][\n]"
18:40:30.210 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "{"message":"No such image: localhost/testcontainers/zd8uyc5sbgr3wjyh:latest"}[\n]"
18:40:30.210 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"
18:40:30.210 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "0[\r][\n]"
18:40:30.210 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"
18:40:30.210 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-00000009: releasing valid endpoint
18:40:30.210 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-00000009: releasing endpoint
18:40:30.210 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-00000009: connection http-outgoing-1 can be kept alive for 3 MINUTES
18:40:30.211 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-00000009: connection released [route: {}->npipe://localhost:2375][total available: 1; route allocated: 1 of 2147483647; total allocated: 1 of 2147483647]
18:40:30.211 [main] DEBUG org.testcontainers.images.AbstractImagePullPolicy - Not available locally, should pull image: localhost/testcontainers/zd8uyc5sbgr3wjyh:latest
18:40:30.211 [main] INFO tc.localhost/testcontainers/zd8uyc5sbgr3wjyh:latest - Pulling docker image: localhost/testcontainers/zd8uyc5sbgr3wjyh:latest. Please be patient; this may take some time but only needs to be done once.
18:40:30.212 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: localhost/testcontainers/zd8uyc5sbgr3wjyh:latest at registry: localhost
18:40:30.212 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator has configFile: C:\Users\marco.luzzara\.docker\config.json (exists) configEnv: DOCKER_AUTH_CONFIG (does not exist) and commandPathPrefix:
18:40:30.212 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator reading from configFile: C:\Users\marco.luzzara\.docker\config.json
18:40:30.213 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - registryName [localhost] for dockerImageName [localhost/testcontainers/zd8uyc5sbgr3wjyh:latest]
18:40:30.213 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Executing docker credential provider: docker-credential-desktop to locate auth config for: localhost
18:40:30.213 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Executing [cmd, /c, docker-credential-desktop, get].
18:40:30.225 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Started Process[pid=29364, exitValue="not exited"]
18:40:30.498 [WaitForProcess-Process[pid=29364, exitValue="not exited"]] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.WaitForProcess - Process[pid=29364, exitValue=1] stopped with exit code 1
18:40:30.499 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Executing [cmd, /c, docker-credential-desktop, get].
18:40:30.512 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Started Process[pid=1252, exitValue="not exited"]
18:40:30.763 [WaitForProcess-Process[pid=1252, exitValue="not exited"]] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.WaitForProcess - Process[pid=1252, exitValue=1] stopped with exit code 1
18:40:30.764 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Got credentials not found error message from docker credential helper - credentials not found in native keychain
18:40:30.764 [main] INFO org.testcontainers.utility.RegistryAuthLocator - Credential helper/store (docker-credential-desktop) does not have credentials for localhost
18:40:30.764 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - No matching Auth Configs - falling back to defaultAuthConfig [null]
18:40:30.764 [main] DEBUG org.testcontainers.dockerclient.AuthDelegatingDockerClientConfig - Effective auth config [null]
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000B: preparing request execution
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.protocol.RequestAddCookies - Cookie spec selected: strict
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.protocol.RequestAuthCache - Auth cache not set in the context
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000B: target auth state: UNCHALLENGED
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000B: proxy auth state: UNCHALLENGED
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000B: acquiring connection with route {}->npipe://localhost:2375
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000B: acquiring endpoint (3 MINUTES)
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000B: endpoint lease request (3 MINUTES) [route: {}->npipe://localhost:2375][total available: 1; route allocated: 1 of 2147483647; total allocated: 1 of 2147483647]
18:40:30.768 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000B: endpoint leased [route: {}->npipe://localhost:2375][total available: 0; route allocated: 1 of 2147483647; total allocated: 1 of 2147483647]
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000B: acquired ep-0000000A
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000B: acquired endpoint ep-0000000A
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000B: executing POST /v1.32/images/create?fromImage=localhost%2Ftestcontainers%2Fzd8uyc5sbgr3wjyh&tag=latest HTTP/1.1
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000A: start execution ex-0000000B
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000A: executing exchange ex-0000000B over http-outgoing-1
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> POST /v1.32/images/create?fromImage=localhost%2Ftestcontainers%2Fzd8uyc5sbgr3wjyh&tag=latest HTTP/1.1
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> accept: application/octet-stream
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> content-type: application/json
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> x-tc-sid: 8a867fb7-ec17-4f40-a2a1-c56204041ac3
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Accept-Encoding: gzip, x-gzip, deflate
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Host: localhost:2375
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> Connection: keep-alive
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 >> User-Agent: Apache-HttpClient/5.0.3 (Java/17)
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "POST /v1.32/images/create?fromImage=localhost%2Ftestcontainers%2Fzd8uyc5sbgr3wjyh&tag=latest HTTP/1.1[\r][\n]"
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "accept: application/octet-stream[\r][\n]"
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "content-type: application/json[\r][\n]"
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "x-tc-sid: 8a867fb7-ec17-4f40-a2a1-c56204041ac3[\r][\n]"
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Accept-Encoding: gzip, x-gzip, deflate[\r][\n]"
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Host: localhost:2375[\r][\n]"
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "Connection: keep-alive[\r][\n]"
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "User-Agent: Apache-HttpClient/5.0.3 (Java/17)[\r][\n]"
18:40:30.769 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 >> "[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "HTTP/1.1 500 Internal Server Error[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Api-Version: 1.43[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Content-Type: application/json[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Date: Fri, 18 Aug 2023 16:40:30 GMT[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Docker-Experimental: false[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Ostype: linux[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Server: Docker/24.0.2 (linux)[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "Transfer-Encoding: chunked[\r][\n]"
18:40:30.784 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << HTTP/1.1 500 Internal Server Error
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Api-Version: 1.43
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Content-Type: application/json
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Date: Fri, 18 Aug 2023 16:40:30 GMT
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Docker-Experimental: false
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Ostype: linux
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Server: Docker/24.0.2 (linux)
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.headers - http-outgoing-1 << Transfer-Encoding: chunked
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000B: connection can be kept alive for 3 MINUTES
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "5b[\r][\n]"
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "{"message":"Get \"http://localhost/v2/\": dial tcp [::1]:80: connect: connection refused"}[\n]"
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "0[\r][\n]"
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[\r][\n]"
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000A: releasing valid endpoint
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000A: releasing endpoint
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000A: connection http-outgoing-1 can be kept alive for 3 MINUTES
18:40:30.785 [docker-java-stream-356572977] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000A: connection released [route: {}->npipe://localhost:2375][total available: 1; route allocated: 1 of 2147483647; total allocated: 1 of 2147483647]
18:40:30.786 [docker-java-stream-356572977] ERROR com.github.dockerjava.api.async.ResultCallbackTemplate - Error during callback
com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"Get \"http://localhost/v2/\": dial tcp [::1]:80: connect: connection refused"}
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:247)
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:269)
at java.base/java.lang.Thread.run(Thread.java:833)
18:40:30.786 [main] WARN tc.localhost/testcontainers/zd8uyc5sbgr3wjyh:latest - Retrying pull for image: localhost/testcontainers/zd8uyc5sbgr3wjyh:latest (119s remaining)
18:40:30.787 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: localhost/testcontainers/zd8uyc5sbgr3wjyh:latest at registry: localhost
18:40:30.787 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - No matching Auth Configs - falling back to defaultAuthConfig [null]
18:40:30.787 [main] DEBUG org.testcontainers.dockerclient.AuthDelegatingDockerClientConfig - Effective auth config [null]
Additional Information
Tested on [1.17.6, 1.18.3], same behavior
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ElasticsearchContainer constructor and trace how the ImageFromDockerfile and DockerImageName flow handles the generated localhost image. Reproduce the Windows Docker Desktop case, then verify that the on-the-fly image is built locally instead of being pulled; add or update a regression test if the existing test structure covers this path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, elasticsearch, java
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100