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.35k stars 46 forks source link

Support multiple docker sockets/proxy #162

Open vutsalsinghal opened 1 year ago

vutsalsinghal commented 1 year ago

Hi,

Love sablier!

I believe this is not super unusual to have multiple docker connections. For example - For example, I've three currently:

machine1:
  socket: /var/run/docker.sock

machine2:
  host: 192.168.0.81
  port: 10001

machine3:
  host: 192.168.0.81
  port: 10002

So basically in the subrequest to sablier backend from nginx (or traefik), when using docker provider, it should also pass something like sablierServer which can then be used to start/stop/query container status.

Homepage project (link) uses this concept to display the status and container stats.

acouvreur commented 1 year ago

Interesting! Seems easy to do! Just to understand correctly, it's to support a customized docker endpoint right ?

Not the ability to connect to multiple docker deamons at once, is that correct ?

vutsalsinghal commented 1 year ago

@acouvreur yes correct!

So maybe in the sablier.yml we can define all the endpoints (default can be /var/run/docker.sock) and in the subrequest call (with dynamic strat), along with the container name (sablierNames), we can also pass the endpoint name (like sablierServer=machine2) so the backend knows how to connect and start/stop/query the correct endpoint for that container.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

undaunt commented 6 months ago

This would be great to have. I put as many containers as possible to the TCP endpoint of https://github.com/Tecnativa/docker-socket-proxy and only expose the portions of the socket that are needed instead of direct socket access.

Sblop commented 6 months ago

I agree on this. I prefer to use a docker proxy, instead of socket access.

This would be great to have. I put as many containers as possible to the TCP endpoint of https://github.com/Tecnativa/docker-socket-proxy and only expose the portions of the socket that are needed instead of direct socket access.

thielj commented 6 months ago

Figured it out,... the docker client used picks up DOCKER_HOST and some other bits from the environment. See https://github.com/acouvreur/sablier/issues/287