itzg / mc-router

Routes Minecraft client connections to backend servers based upon the requested server address
MIT License
554 stars 36 forks source link

Enable docker (non swarm) auto discovery #110

Closed Foxite closed 3 months ago

Foxite commented 2 years ago

Docker swarm support is added (#60) and it should work with non-swarm deployments as well, however if you start it with --in-docker-swarm you get this:

time="2022-08-15T17:23:00Z" level=fatal msg="Unable to start docker swarm integration" error="Error response from daemon: This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again."

I suggest adding --in-docker to enable autodiscovery in a plain docker engine deployment.

n1xx1 commented 1 year ago

The problem with this is that service discovery using a non-swarm environment is different than the swarm one. It requires to reimplement the discovery code for a list of containers instead of a list of services. I don't think that setting up docker swarm is so difficult (https://dockerswarm.rocks/), but if someone has time it's not that hard to do, most of the labels logic should be reusable.

itzg commented 3 months ago

Thanks to @devmattrick the latest image now includes non-Swarm Docker container discovery