Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker-compose having problems with labels

I'm trying to setup Traefik reverse proxy using example shown in their docs. When I try to bring up 'whoami' service I get following error:

Creating test_whoami_1 ... 

ERROR: for test_whoami_1  dictionary update sequence element #0 has length 22; 2 is required

ERROR: for whoami  dictionary update sequence element #0 has length 22; 2 is required
Traceback (most recent call last):
  File "bin/docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 68, in main
  File "compose/cli/main.py", line 121, in perform_command
  File "compose/cli/main.py", line 952, in up
  File "compose/project.py", line 455, in up
  File "compose/parallel.py", line 70, in parallel_execute
ValueError: dictionary update sequence element #0 has length 22; 2 is required
Failed to execute script docker-compose

Example docker-compose.yml can be found in Traefik docs: test/docker-compose.yml

version: '3.3'

services:
  whoami:
    image: emilevauge/whoami
    networks:
      - web
    labels:
      - "traefik.backend=whoami"
      - "traefik.frontend.rule=Host:whoami.docker.localhost"

networks:
  web:
    external:
      name: traefik_webgateway

traefik/docker-compose.yml

version: '3.3'

services:
  proxy:
    image: traefik:1.4.1
    restart: always
    ports:
      - 80:80
      - 8080:8080
    command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
      - "./traefik.toml:/traefik.toml"
    container_name: traefik

networks:
  webgateway:
    driver: bridge

Using following docker and docker-compose versions:

Docker version 17.09.0-ce, build afdb6d4
docker-compose version 1.17.0, build ac53b73
like image 930
metalcamp Avatar asked Jul 31 '26 17:07

metalcamp


2 Answers

Solution: downgrade to docker-compose v1.16.1.

like image 175
metalcamp Avatar answered Aug 03 '26 11:08

metalcamp


Docker compose labels is included in version v3.3 and you're running version 1.17.0

Please see the doc for more info.

like image 24
juanlumn Avatar answered Aug 03 '26 11:08

juanlumn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!