Coder Social home page Coder Social logo

Docker for Mac about docker-it-scala HOT 8 CLOSED

whisklabs avatar whisklabs commented on June 26, 2024 1
Docker for Mac

from docker-it-scala.

Comments (8)

dlouwers avatar dlouwers commented on June 26, 2024 1

Looks like the Spotify Docker API has OSX socket support covered. Maybe switch to that lib?

from docker-it-scala.

viktortnk avatar viktortnk commented on June 26, 2024

Thanks @dlouwers

I put config variables into README section. Works for me that way as well

from docker-it-scala.

Ciaran0 avatar Ciaran0 commented on June 26, 2024

Cant get this working even with this work around
Is there anything else I could try?

info] DeferredAbortedSuite: [info] Exception encountered when attempting to run a suite with class name: org.scalatest.DeferredAbortedSuite *** ABORTED *** [info] java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl [info] at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122) [info] at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91) [info] at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69) [info] at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:80) [info] at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:99) [info] at org.glassfish.jersey.client.JerseyWebTarget.<init>(JerseyWebTarget.java:71) [info] at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:185) [info] at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:70) [info] at com.github.dockerjava.jaxrs.DockerCmdExecFactoryImpl.init(DockerCmdExecFactoryImpl.java:214) [info] at com.github.dockerjava.core.DockerClientImpl.withDockerCmdExecFactory(DockerClientImpl.java:159) [info] ... [info] Cause: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl [info] at java.net.URLClassLoader$1.run(URLClassLoader.java:372) [info] at java.net.URLClassLoader$1.run(URLClassLoader.java:361) [info] at java.security.AccessController.doPrivileged(Native Method) [info] at java.net.URLClassLoader.findClass(URLClassLoader.java:360) [info] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [info] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) [info] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [info] at java.lang.Class.forName0(Native Method) [info] at java.lang.Class.forName(Class.java:259) [info] at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:62) [info] ...

I have exported the envirnment variables but when I do
docker-machine env
These do not seem to have been set. I am using the ZSH shell, could this be an issue?
docker-machine env export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/Users/ciaran/.docker/machine/machines/default" export DOCKER_MACHINE_NAME="default"

from docker-it-scala.

dlouwers avatar dlouwers commented on June 26, 2024

@Ciaran0 Using docker-machine implies that you are not using the native OSX docker beta.

Unfortunately this http interface has been removed in the latest version. I am now trying to make it work using socat:

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

Will have to combine this with the Netty DockerCmdExecFactory in order to get this workaround to work apparently. Ultimately there should be better Java socket file support on OSX though. Other languages like Go or Python are not having issues at all.

from docker-it-scala.

viktortnk avatar viktortnk commented on June 26, 2024

Ideally, we'd like to make implementation configurable if we go that way. I'm not vary familiar with spotify client and don't know it's strengths/weaknesses.

Unfortunately it is quite unlikely that I can look into it this week. Personally rolling back my machine to boot2docker temporarily :(

from docker-it-scala.

dlouwers avatar dlouwers commented on June 26, 2024

Can now confirm a workaround:

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

And then use this alternative Docker implementation:

class Docker(override val config: DockerClientConfig) extends com.whisk.docker.Docker(config) {
      override val client = DockerClientBuilder.getInstance(config).withDockerCmdExecFactory(new com.github.dockerjava.netty.DockerCmdExecFactoryImpl).build()
      override val host = config.getDockerHost.getHost
    }

Can confirm that this works, though it can hardly be called secure running over plain http.

from docker-it-scala.

francisdb avatar francisdb commented on June 26, 2024

I think this can be closed, the README shows how to use this lib using the Spotify docker client which works both on mac / linux (win?)

override implicit val dockerFactory: DockerFactory = new SpotifyDockerFactory(DefaultDockerClient.fromEnv().build())

from docker-it-scala.

viktortnk avatar viktortnk commented on June 26, 2024

Yep, agree. Closing

from docker-it-scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.