Docker Community Forums

Share and learn in the Docker community.

Help with error in yml

Hello,

Are you able to help me, i have an error with my ubuntu 20.04 and Docker-compose.
I have this error

ERROR: The Compose file './docker-compose.yml' is invalid because: 'jackett', 'lidarr', 'plex', 'radarr', 'sonarr' do not match any of the regexes: '^x-'

And here my yml :

version: '3.7'
services:
  deluge:
    image: linuxserver/deluge:latest
    container_name: deluge
    restart: unless-stopped
#    network_mode: "host"
    ports:
      - 8112:8112
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=Europe/Paris
    volumes:
      - /home/media/deluge/config:/config
      - ${PATH_MEDIA}:/downloads

jackett:
    image: linuxserver/jackett:latest
    container_name: jackett
    restart: unless-stopped
    network_mode: "host"
    ports:
      - 9117:9117
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=Europe/Paris
    volumes:
      - /home/media/jackett/config:/config
      - /etc/localtime:/etc/localtime:ro

sonarr:
    image: linuxserver/sonarr:latest
    container_name: sonarr
    restart: unless-stopped
    network_mode: "host"
    ports:
      - 8989:8989
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=Europe/Paris
    volumes:
      - /home/media/sonarr/config:/config
      - ${PATH_MEDIA}:/data

radarr:
    image: linuxserver/radarr:latest
    container_name: radarr
    restart: unless-stopped
    network_mode: "host"
    ports:
      - 7878:7878
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=Europe/Paris

Whitespace matters in YAML. Your jackett, sonarr and radarr are services, so should be indented to be children of services.

Well i understand, thank you very much, sorry i’m beginner. If i remove the “#” i have this error, do you know why ?

docker.errors.InvalidArgument: "host" network_mode is incompatible with port_bindings