Closed margic closed 6 years ago
For what you mention, it seems that the problem could be in docker-java library. The first thing that should be done is create a simple example with only docker-java and see if it can connect and create a docker instance using native docker in Mac, just to discard where is the problem, since in theory and from the point of view of Cube, we are only calling docker-java methods and it works with native Linux.
But thank you so much for initial investigation.
I saw that ticket. I started trying to update the docker-java client to use the newer dependency. There will be downstream changes necessary in arquillian cube for both docker-java api changes and a need to support the new default mac option in addition to boot2docker currently the mac default.
There are changes to the test suite for the docker-java that are unrelated (they are due to changes in docker 1.12) that I need to fix before I can submit the docker-java pull request. Once that is done I'll look again at this. There is definitely some need for change on arquillian cube. Should we keep this issue open?
yes let's leave it opened until we know how to manage this.
Thanks for your research and of course any PR when everything is fixed is welcomed as well.
I think you can close this now. Arquillian Cube (1.7.0 and 1.9.0) works great with Docker for Mac now.
<extension qualifier="docker">
<property name="serverVersion">1.32</property>
<property name="serverUri">unix:///var/run/docker.sock</property>
<property name="definitionFormat">CUBE</property>
<property name="tlsVerify">false</property>
<property name="dockerContainers">
wildfly-remote:
image: local/wildfly-it:latest
exposedPorts: [9990/tcp, 8080/tcp]
links: [peopledb]
await:
strategy: polling
portBindings: [9990/tcp, 8080/tcp]
</property>
</extension>
The newly released Docker for mac https://docs.docker.com/docker-for-mac replaces boot2docker supported by arquillian. The biggest difference is the native use of the hypervisor which uses a unix socket instead of tcp in the docker host.
This is actually desirable however arquillian cube is configured to use boot2docker on mac by default using the default boot2docker url. If the serverUri is overridden see below:
The docker-java client version used attempt to NativeUnixSocket causing the exception below.
This exception is thrown by dependency of docker-java de.gesellix:unix-socket-factory:2015-01-27T15-02-14. This dependency wraps a version of kohlschutter/junixsocket that uses native libraries on unix and mac osx. This version of junixsocket uses a class loader to load the library from the jar classloader and to get around this the unix-socket-factory jar is build with the libs for unix packaged in the jar. However the libs for mac osx are not supplied and attempts to provide them do not work do to the classloader.
A newer version of gesellix uses the newer kohlschutter/junixsocket that changes the way the class loading operates. If overriding the import in my pom as follows
With the 2016 version it does connect to the docker for mac using the unix socket and creates the container. However it fails to start with the following exception.