@rahul080327 sorry for the long silence, I’m struggling to find the time to try this out right now but I now asked my colleague to give it a try and will let you know. Our hope is to switch nextjournal over from spotify-docker eventually…
@christian.paling maybe lein deps :plugin-tree
would solve this. And the docker thing can be separated out a bit by having multistage docker files wherein you just copy the uber jar into a plain open jdk image with a lot less size 🙂 I think not having the sources and the huge ~/.m2 dir into your deployment artifact is cleaner
@mkvlr awesome! lemme know what can be improved!
@rahul080327 one thing that I noticed: there’s no support for checkpoint, yet, correct? https://docs.docker.com/engine/reference/commandline/checkpoint/ This is currently an experimental feature in docker (but we’re using it). Is there an easy way to include it? I see it’s not in https://github.com/lispyclouds/clj-docker-client/blob/master/resources/api/v1.40.yaml
@mkvlr okay so this is interesting as from my searches I dont think this a properly exposed API. (i may be wrong). Couldn't find it in any of the API clients too. From really deep searching in the docker daemon source I see this: https://github.com/moby/moby/pull/22049/files#diff-8038ade87553e3a654366edca850f83dR11
looks like this has been implemented for a while but somehow not exposed?
I tried CURLing the endpoints with
curl --unix-socket /var/run/docker.sock "<http://docker/containers/conny/checkpoints>"
and it is answering! 😮
since this is not in the swagger spec, you can try to use the low-level functions in the client though
(req/fetch {:conn (connect {:uri "unix:///var/run/docker.sock"})
:url "/containers/conny/checkpoints"})
needs a (require '[clj-docker-client.requests :as req])
this should technically work i think. but you need to parse the (JSON?) responses manually.
i really think the client should stick to published APIs, but what are your thoughts @mkvlr?
apologies as I haven't really used checkpoints before 😕
here are some low level comment examples: https://github.com/lispyclouds/clj-docker-client/blob/master/src/clj_docker_client/core.clj#L146-L163
@rahul080327 awesome thanks! I also don’t really understand why it’s not in the swagger api file. Do you know of a way to regenerate this with experimental flags enabled?
it does exist in the docker command line api…
yes if you know that please answer this too: https://stackoverflow.com/questions/59618439/access-dockers-swagger-yaml-from-docker-api-or-daemon 😛
i really tried hard to find it, but i think this needs source compilation?
ah right, that would be ideal
I will try to find out more, but is this a good place for you to start?
yes, for sure!
docker + swagger is pretty much ungooglable
yeah its totally what we are not looking for
any leads on how to make this lib more flexible is much appreciated too!
the fact that this is un documented and none of the other clients support is is super weird
> If you omit the version-prefix, the current version of the API (v1.40) is used. For example, calling `/info` is the same as calling `/v1.40/info`. Using the API without a version-prefix is deprecated and will be removed in a future release.
what’s being served on /info
?
this returns a map of the system info
ok, not what we’re looking for
I'm looking at the source of the docker cli to see how its doing it
and https://github.com/moby/moby/blob/master/api/swagger.yaml is just checked in, not generated right?
looks like it, i at least couldnt find a way to generate it without source compilation. but again, i could be wrong
otherwise why would it have so many contributors i guess?
gotta go for lunch, bbl
yes, looks like it’s manual
fun discussion. lemme know if you find anything
also when would be a good time to release too 🙂