Closed johnflavin closed 6 years ago
To verify this wasn't an issue with the old versions of these dependencies being cached, I removed all the jnr dependencies from my gradle and maven caches. When I recompiled my project, it downloaded these versions:
Download https://jcenter.bintray.com/com/github/jnr/jnr-unixsocket/0.18/jnr-unixsocket-0.18.jar
Download https://jcenter.bintray.com/com/github/jnr/jnr-ffi/2.1.4/jnr-ffi-2.1.4.jar
Download https://jcenter.bintray.com/com/github/jnr/jnr-constants/0.9.8/jnr-constants-0.9.8.jar
Download https://jcenter.bintray.com/com/github/jnr/jnr-enxio/0.16/jnr-enxio-0.16.jar
Download https://jcenter.bintray.com/com/github/jnr/jnr-posix/3.0.35/jnr-posix-3.0.35.jar
Download https://jcenter.bintray.com/com/github/jnr/jffi/1.2.15/jffi-1.2.15.jar
Download https://jcenter.bintray.com/com/github/jnr/jffi/1.2.15/jffi-1.2.15-native.jar
Download https://jcenter.bintray.com/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar
I get the same error.
@johnflavin Thanks for reporting. I was able to run this code successfully.
final DockerClient client = DefaultDockerClient.builder()
.uri("unix:///var/run/docker.sock")
.build();
client.ping();
System.out.println(client.version());
I deleted my cached jnr jars before hand. I ran on ubuntu 14.04 trusty with docker version
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:06:06 2017
OS/Arch: linux/amd64
Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:06:06 2017
OS/Arch: linux/amd64
Experimental: false
dxia@guc3-heliosjenkins-b-49ey:~/helios$ ls -ail /var/run/docker.sock
2996509702 srw-rw---- 1 root docker 0 Nov 13 06:20 /var/run/docker.sock
The system user I used to run the tests is in the docker group.
On my mac I use docker-machine and connect on a TCP socket. Are you using docker for mac?
Yes, this occurs using docker for mac and connecting over a unix socket. (And, side note, docker for mac cannot be configured to use TCP. If you try to set the hosts
option in the settings json, it conflicts with the --hosts
option hard-coded into the docker command line options in the xhyve VM. See docker/for-mac#1595. Not particularly relevant, but I wanted to kvetch about it.)
When I create a docker-machine
VM and connect over TCP, everything runs fine.
But I would think that isn't surprising. The jnr changes were about the code for unix socket connections. Nothing about the TCP connections should be impacted.
I've updated the issue title and description to explicitly include docker for mac details.
Thanks for the update. My first test case I wrote about above was on ubuntu with unix socket. Let me try docker for mac now.
I think I've figured out that this is a problem with one of my other dependencies packaging an older version of the jnr libraries. This isn't a docker-client problem, it's just a me problem.
phew, thanks. I was worried for a second. For the record, the shaded docker-client jar works with unix socket on DFM running docker 17.09.
Description
After updating my library to version 8.9.2, I cannot connect to docker with a unix socket. The errors I get suggest something is wrong with the new jnr version from #918.
How to reproduce
What do you expect
The client will connect to docker via the unix socket. The ping will return successfully.
What happened instead
The ping fails with an exception. See stack trace below.
Software:
docker version
Server: Version: 17.11.0-ce-rc3 API version: 1.34 (minimum version 1.12) Go version: go1.8.5 Git commit: 5b4af4f Built: Wed Nov 8 03:09:46 2017 OS/Arch: linux/amd64 Experimental: true