question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docker for mac compatibility

See original GitHub issue

Hello,

I am beta testing docker 4 mac and when I disable docker-machine my test suite fails with

java.lang.UnsatisfiedLinkError: Could not find library in classpath, tried: [libjunixsocket-macosx-1.8-x86_64.dylib, libjunixsocket-macosx-1.5-x86_64.dylib]
    at org.newsclub.net.unix.NativeUnixSocket.load(NativeUnixSocket.java:81)
    at org.newsclub.net.unix.NativeUnixSocket.<clinit>(NativeUnixSocket.java:112)
    at org.newsclub.net.unix.AFUNIXSocket.<init>(AFUNIXSocket.java:36)
    at org.newsclub.net.unix.AFUNIXSocket.newInstance(AFUNIXSocket.java:50)
    at org.testcontainers.shaded.com.github.dockerjava.jaxrs.ApacheUnixSocket.<init>(ApacheUnixSocket.java:53)
    at org.testcontainers.shaded.com.github.dockerjava.jaxrs.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:65)

The latest version of test containers (1.0.3 at the time of this writing) uses docker-java 2.2.0 (https://github.com/testcontainers/testcontainers-java/blob/2e227e29eded31c0b2d45a5351cc108994327394/core/pom.xml#L20) so I assume it is safe to say that docker-java 2.2.0 is not compatible with docker 4 mac. (I tried adding the dylib to my classpath and got further errors, also the compiled dylib seems hard to find and it feels very cumbersome to have to add it to the classpath manually).

I want to create a bug report to org.testcontainers asking them to upgrade docker-java to a docker4mac compatible version so I checked out the repository and tried to build master using only docker4mac. I first got an error in com.github.dockerjava.client.DockerClientTest which seems to be the integration test. The error was that $HOME/.docker/certs did not exist. After creating that directory, I get the following output :

beforeTest(com.github.dockerjava.client.DockerClientTest)  Time elapsed: 2.359 sec  <<< FAILURE!
javax.ws.rs.ProcessingException: org.apache.http.conn.UnsupportedSchemeException: https protocol is not supported
    at com.github.dockerjava.client.DockerClientTest.beforeTest(DockerClientTest.java:32)
Caused by: org.apache.http.conn.UnsupportedSchemeException: https protocol is not supported
    at com.github.dockerjava.client.DockerClientTest.beforeTest(DockerClientTest.java:32)


Results :

Failed tests:
com.github.dockerjava.client.DockerClientTest.beforeTest(com.github.dockerjava.client.DockerClientTest)
  Run 1: DockerClientTest.beforeTest:32->AbstractDockerClientTest.beforeTest:60 » Processing
  Run 2: PASS
  Run 3: PASS
  Run 4: PASS
  Run 5: PASS
  Run 6: PASS
  Run 7: PASS
  Run 8: PASS
  Run 9: PASS
  Run 10: PASS
  Run 11: PASS
  Run 12: PASS
  Run 13: PASS
  Run 14: PASS
  Run 15: PASS
  Run 16: PASS
  Run 17: PASS
  Run 18: PASS
  Run 19: PASS
  Run 20: PASS
  Run 21: PASS
  Run 22: PASS
  Run 23: PASS
  Run 24: PASS
  Run 25: PASS
  Run 26: PASS
  Run 27: PASS
  Run 28: PASS
  Run 29: PASS
  Run 30: PASS
  Run 31: PASS
  Run 32: PASS
  Run 33: PASS
  Run 34: PASS
  Run 35: PASS
  Run 36: PASS
  Run 37: PASS
  Run 38: PASS
  Run 39: PASS
  Run 40: PASS
  Run 41: PASS
  Run 42: PASS
  Run 43: PASS
  Run 44: PASS
  Run 45: PASS
  Run 46: PASS
  Run 47: PASS
  Run 48: PASS
  Run 49: PASS
  Run 50: PASS
  Run 51: PASS
  Run 52: PASS
  Run 53: PASS
  Run 54: PASS
  Run 55: PASS
  Run 56: PASS
  Run 57: PASS
  Run 58: PASS
  Run 59: PASS
  Run 60: PASS
  Run 61: PASS
  Run 62: PASS
  Run 63: PASS
  Run 64: PASS
  Run 65: PASS
  Run 66: PASS
  Run 67: PASS
  Run 68: PASS
  Run 69: PASS
  Run 70: PASS
  Run 71: PASS
  Run 72: PASS
  Run 73: PASS
  Run 74: PASS
  Run 75: PASS
  Run 76: PASS
  Run 77: PASS
  Run 78: PASS
  Run 79: PASS
  Run 80: PASS
  Run 81: PASS
  Run 82: PASS
  Run 83: PASS
  Run 84: PASS
  Run 85: PASS
  Run 86: PASS
  Run 87: PASS
  Run 88: PASS
  Run 89: PASS


Tests run: 462, Failures: 1, Errors: 0, Skipped: 458

And I am unsure what to conclude, the test failure seems to suggest that the lastest master is not docker4mac compatible either but a single failed test seems surprising …

Can you help me troubleshoot or maybe you already know if master is compatible with docker4mac …

Thanks for your help jean

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:9
  • Comments:160 (96 by maintainers)

github_iconTop GitHub Comments

8reactions
opbcommented, May 24, 2016

Just to add to this - I’m using Pycharm by jetbrains on Mac and trying to set up using a remote docker interpreter. I believe Pycharm is using docker-java.

Instead of using docker machine integration, I’m trying to use the “local” docker as provided by the new beta docker functionality (1.11.1-beta10 ), by setting the docker API address in Pycharm to unix:///var/run/docker.sock. This yields the following message:

Cannot connect: java.ws.rs.ProcessingException: Could not
initialise class org.newsclub.net.unix.NativeUnixSocket

Happy to provide more info if it’s of use to anyone.

6reactions
dlouwerscommented, Apr 29, 2016

@gesellix I meant insecure as in cross site scriptable from the browser afaics

@eduardolundgren I have been able to forward the socket to tcp on localhost

socat TCP-LISTEN:2375,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock &
export DOCKER_HOST=tcp://localhost:2375
unset DOCKER_TLS_VERIFY

This seems to work well since I can cURL in perfectly. Docker cli is also happy. However docker-java doesn’t seem to pick it up yet somehow. Will have to investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install on Mac | Docker Documentation
As new major versions of macOS are made generally available, Docker stops supporting the oldest version and supports the newest version of macOS...
Read more >
Install Docker for Mac
Install and run Docker for Mac · Double-click Docker.dmg to open the installer, then drag Moby the whale to the Applications folder. Install...
Read more >
Install Docker on macOS | Runnable Docker Guides
Docker for Mac offers a Mac native application that installs in /Applications . It creates symlinks (symbolic links) in /usr/local/bin for docker and ......
Read more >
Install Docker Desktop on Mac
Install and run Docker Desktop on Mac · Double-click Docker.dmg to open the installer, then drag the Docker icon to the Applications folder....
Read more >
Why is Docker on macOS So Much Worse Than Linux?
Install Docker for Mac Edge Build · In the Docker UI, go to Resources => File Sharing and specify what folders you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found