Tecnativa / docker-socket-proxy

Proxy over your Docker socket to restrict which requests it accepts
Apache License 2.0
1.3k stars 156 forks source link

Docker API version compatibility #82

Closed mrclschstr closed 1 year ago

mrclschstr commented 1 year ago

Just a quick question: You state in your README that you support the API up to version 1.37, meaning I cannot use the proxy with Docker 20.10? Or am I misunderstanding something?

chessmango commented 1 year ago

From your link, the version matrix stats a maximum API version rather than a minimum. I believe Docker engine releases continue to support previous API versions, so you can still target v1.18 while using Docker engine 20.10 (and 23.0.2, as I've found)

I'm not sure about why those versions are specifically listed in the readme, but I'd assume it's more "this was valid at the time of writing" rather than an explicit version constraint.

The workhorse of this image is: https://github.com/Tecnativa/docker-socket-proxy/blob/2d108070c4711300c0a33e43b45a01f397ea94b2/haproxy.cfg#L44-L69

Where HAProxy rules set boundaries depending on environment variables used/allowed.

Looking at changes from API 1.37 to current (1.42), it seems the regex used here wouldn't break anything anyway, so if your API consumer targets 1.42, then you're likely fine - though your mileage may vary.

mrclschstr commented 1 year ago

I'll give it a shot. Thanks for clarification!

chessmango commented 1 year ago

Sure! I'd also recommend using the :edge tag for now, as :latest is the latest tagged release - v0.1.1 from 2021 :)