gliderlabs / registrator

Service registry bridge for Docker with pluggable adapters
http://gliderlabs.com/registrator
MIT License
4.66k stars 912 forks source link

All service names start with sha265 when containers are started with the new compose-cli #701

Open rakyi opened 3 years ago

rakyi commented 3 years ago

Description of the problem:

When I run my containers with the new compose-cli (docker compose), registrator uses string "sha256" as the name/prefix for all services in Consul, e.g. Consul itself is registered as sha256-8300. Using old docker-compose works ok, e.g. Consul gets registered as consul-8300.

How reproducible:

Using this docker-compose.yml:

version: "3"

services:
  consul:
    image: consul:latest
    ports:
      - "8500:8500"
  registrator:
    image: gliderlabs/registrator
    command: "consul://consul:8500"
    depends_on:
      - consul
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock

When you run docker compose up you should see "sha256-8500" at http://localhost:8500/v1/catalog/services. Running docker-compose up instead you should see "consul-8500" being registered.

jstaro commented 3 years ago

Can confirm. Was hit by this myself.

Does anyone know of an alternative to this project since it seems dead/unmaintained? Would rather go down that road than trying to hack a fix in a self-maintained fork.

brunocascio commented 3 years ago

Can confirm. Was hit by this myself.

Does anyone know of an alternative to this project since it seems dead/unmaintained? Would rather go down that road than trying to hack a fix in a self-maintained fork.

This one? https://github.com/marcuslinke/registrator/tree/swarm-mode (latest image is marcuslinke/registrator:2019-03-28)

jstaro commented 3 years ago

@brunocascio Thanks, that looks like it has a bunch of nice fixes. However, not surprisingly, it exhibits the same naming problem with Docker 20.10 and the docker compose v2 CLI.

Does anyone know if the problem could have to do with registrator itself, or maybe go-dockerclient?