acouvreur / sablier

Start your containers on demand, shut them down automatically when there's no activity. Docker, Docker Swarm Mode and Kubernetes compatible.
https://acouvreur.github.io/sablier/
GNU Affero General Public License v3.0
1.16k stars 43 forks source link

Support for docker-socket-proxy #287

Closed thielj closed 1 day ago

thielj commented 2 months ago

Hi,

can you add support for controlling docker through a network proxy, instead of requiring direct access to the socket, please? Similar to what setting DOCKER_HOST or using docker -H <endpoint> would do.

For example, through a configuration setting like this:

    endpoint: "unix:///var/run/docker.sock"     # Default, listen to the UNIX Docker socket
    #endpoint: "tcp://docker-socket-proxy:2375"   # Use a network proxy instead

Ideally, this would be configurable per service or middleware, which would allow managing a containers on different hosts.

See https://github.com/Tecnativa/docker-socket-proxy and https://flast101.github.io/docker-privesc/ for some background info.

thielj commented 2 months ago

Actually, I just checked if the docker client library you're using might support this already And yes, it does :) Just set set an environment variable like DOCKER_HOST: 'tcp://docker-socket-proxy:2375'.

Maybe worth mentioning in the docs?

https://pkg.go.dev/github.com/docker/docker/client#EnvOverrideHost

acouvreur commented 2 months ago

Hello!

Yes the library is configured to support all environnement variables. Yes we could add it to the docs!

Sblop commented 4 weeks ago

Hi. While this works, the sablier container now runs at 100% CPU. Logs doesnt assist.

acouvreur commented 1 day ago

Closing this in favor of #272