Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Both Apache and ZeroDep clients ignore socket URLs #2322

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

Open
fedinskiy opened this issue Apr 22, 2024 · 1 comment
Open

Both Apache and ZeroDep clients ignore socket URLs #2322

fedinskiy opened this issue Apr 22, 2024 · 1 comment

Comments

@fedinskiy
Copy link

fedinskiy commented Apr 22, 2024

I am running podman, which handles connections over unix socket on unix:///run/user/1000/podman/podman.sock. When I create a new instance of a DockerClientImpl, I provide an URI for this socket as a dockerHost parameter for both DefaultDockerClientConfig and ApacheDockerHttpClient(or ZerodepDockerHttpClient)[1]. For some reason, both http clients ignore this parameter and try to connect to "unix://localhost:2375" instead[2], where podman is not serving anything by default (since this is not recommended as not safe[3]).

This behaviour breaks both promise to work with podman while its "compatibility level works correctly" [3] and the description of supported transports[4], where both ZeroDep and ApacheHttp are described as having "Unix sockets support".

[1]

DefaultDockerClientConfig dockerClientConfig = DefaultDockerClientConfig.createDefaultConfigBuilder()
        .build();
URI dockerHost = dockerClientConfig.getDockerHost();
System.out.println("Docker is on " + dockerHost);
ApacheDockerHttpClient dockerHttpClient = new ApacheDockerHttpClient.Builder()
        .dockerHost(dockerHost)
        .sslConfig(dockerClientConfig.getSSLConfig()).build();
dockerClientInstance = DockerClientImpl.getInstance(dockerClientConfig, dockerHttpClient);

[2] https://github.com/docker-java/docker-java/blob/main/docker-java-transport-httpclient5/src/main/java/com/github/dockerjava/httpclient5/ApacheDockerHttpClientImpl.java#L70
[3] https://proofnet.de/publikationen/podman_tcp_api.html
[4] #1423
[5] https://github.com/docker-java/docker-java/blob/main/docs/transports.md

@fedinskiy fedinskiy changed the title Both Apache and ZeroDep clients ignore socket settings Both Apache and ZeroDep clients ignore socket URLs Apr 22, 2024
Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant