palletops / lein-uberimage

A Leiningen plugin to generate a docker image that runs a project's uberjar.
Eclipse Public License 1.0
136 stars 10 forks source link

Accept unix endpoints for DOCKER_ENDPOINT #17

Open mping opened 9 years ago

mping commented 9 years ago

The standard ubuntu install puts the docker api under a unix socket. The DOCKER_ENDPOINT should work with unix protocol: DOCKER_ENDPOINT=unix:///var/run/docker.sock lein uberimage ...

The current workaround is to bind the docker daemon to multiple ports: DOCKER_OPTS="--host=tcp://localhost:2375 --host=unix:///var/run/docker.sock

hugoduncan commented 9 years ago

This will require two things: using JNA to access the unix socket, and getting the http library to communicate over the unix socket.

mping commented 9 years ago

I honestly thought java supported unix sockets. It seems that you are right. There's some unix socket libs for java, but I have no idea on how to integrate them, since I'm quite new to clojure.

Another possible workaround for now is to use socat to redir localhost:2375 to the docker socket.

ssuehs-shango commented 9 years ago

so close...