Docker auto discovery: Difference between docker-compose deployements and Docker API deployments

I am seeing a difference in service names when I use Traefik auto discovery:

The first container was uploaded via Docker API - the name is prefixed with a slash (which is the regular internal representation) - the second container was created by Docker compose.

The first container doesn't allow drill down in Traefik's dashboard because of the slash: it leads to a double slash in the URL which yields a 404 error.

What's worse: the loadbalancer doesn't work because of the slash :frowning:

Hello,

could you give your configuration?

and a small reproducible case.

thanks

Hello,

Docker Desktop 2.1.0.3
Engine 19.03.02
Compose 1.24.1

docker-compose.yaml (inside folder /infrastructure/)

version: "3.5"

networks:
  internal:
    external: false
    name: internal
  web:
    external: false
    name: web

services:

  # Reverse Proxy
  traefik:
    image: traefik:v2.0
    container_name: api-gateway
    command: --api.insecure=true --providers.docker
    networks:
      - web
      - internal
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - d:/docker/traefik:/etc/traefik
      - /var/run/docker.sock:/var/run/docker.sock:ro

# Test and diagnosis feedback
  whoami:
    image: emilevauge/whoami
    container_name: client-info
    networks:
      - internal
    labels:
      - traefik.http.routers.client-info.rule=Host(`whoami.docker.local`)

Needs HOST entry whoami.docker.local mapped to 127.0.0.1

Please note: Because of Windows 10 there's a volume mount to d:/docker/traefik

How to reproduce
Run compose up, then compose down. Remove whomai from compose and compose up again. Then run whoami container from docker cli.

Thanks I reopened your issue and fixed the bug https://github.com/containous/traefik/pull/5491