Skip to content

Connection to Docker API fails on Windows with default configuration. #1653

@slindenberg

Description

@slindenberg

Hello, it seems that the default configuration (when run on Windows 10):

DefaultDockerClientConfig.createDefaultConfigBuilder().build();

is setting the docker host to a unix socket. After the first connection (Apache http 5 transport) this is printed in the console:

15:34:50.030 [main] DEBUG org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000001 acquiring connection with route {}->unix://localhost:2375
15:34:50.030 [main] DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000001 acquiring endpoint (3 MINUTES)
15:34:50.031 [main] DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000001 endpoint lease request (3 MINUTES) [route: {}->unix://localhost:2375][total available: 0; route allocated: 0 of 100; total allocated: 0 of 100]
15:34:50.036 [main] DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000001 endpoint leased [route: {}->unix://localhost:2375][total available: 0; route allocated: 1 of 100; total allocated: 1 of 100]
15:34:50.046 [main] DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000001 acquired ep-0000000000
15:34:50.047 [main] DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000001 acquired endpoint ep-0000000000
15:34:50.047 [main] DEBUG org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000001 opening connection {}->unix://localhost:2375
15:34:50.047 [main] DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000000 connecting endpoint (30000000000 NANOSECONDS)
15:34:50.048 [main] DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000000 connecting endpoint to unix://localhost:2375 (30000000000 NANOSECONDS)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'write': Die angegebene Prozedur wurde nicht gefunden.

("Die angegebene Prozedur wurde nicht gefunden" ~ "Procedure not found")

As you can see, there are entries like route: {}->unix://localhost:2375.

When I explicitly define the config like this, it is connecting successfully:

DefaultDockerClientConfig.createDefaultConfigBuilder() .withDockerHost("tcp://localhost:2375") .withDockerTlsVerify(false) .build();

I have created an small example on GitHub, which can be build with Maven. I used Java 14 in this case, which can be change in pom.xml.

Any info appreciated, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions