Fork me on GitHub

thanks @borkdude. @rahul080327 - I was looking at and wondering what would take to make it work with babashka. It seems that JDK 16 added support for java unix sockets and JDK 11 added a new HTTP client. Using those instead of java libraries would make contajners easier to port to bababshka and probably easier to maintain (no dependencies)


what do you think about that ?


(I am looking at conajners because we use docker swarm at work and tooling sucks for swarm )


I made a stack templating system (a poor man's kubernetes helm implementation) and I use bb to render and manage deployments


my motivation is to be able to do more - maybe drop the native client requirement - for managing stuff like configs, secrets, etc


Hey @eugen.stan yeah this is something on my list too. JEP-380 adds the ability to talk to sockets, but i couldnt get the standard java 11 http client to accept a unix:// domain string or make it somehow implement some classes to be a transport layer. I could spend more time to figure it out but probably similar things to as in Alternatively I have been thinking of using babashka.curl as the transport and make the unixsocket-http and as optional deps and load either of them dynamically based on a flag during the client creation. If you ask me the latter could be an easier path that figuring out the java inheritance mess. we could have this as the first cut and then iterate over it? curl can handle both the requirements of unix sockets and pem files for mTLS


making contajners use babashka.curl should be relatively straightforward, changes mainly needed in impl.clj


the unixsocket-http lib that you see was also mostly pulled out of clj-docker-client, the predecessor of contajners


if i remember correctly, the biggest issue i faced was to get http going over unix sockets, raw traffic was possible but the java 11 client was a tough nut to crack, and docker needs to do http over unix


Of course, PRs welcome! Im quite short of time at the moment, but PRs will be swiftly dealt with! 😄


@eugen.stan I added an example with #nbb and dockerode (a library which seems kind of maintained) here: Perhaps another idea.