Docker compose additional property is not allowed

I have been trying to figure out for a few weeks what this means, as whatever template I use states additional xteve is not allowed.

xteve:
    container_name: xteve
    environment:
      - PUID=1001
      - PGID=100
      - TZ=Pacific/Auckland
    ports:
      - 34400:34400
    volumes:
      - /srv/dev-disk-by-uuid-129ba3c6-37fd-4ee3-ad98-3e035875b93f/Appdata/xteve:/home/xteve/conf
      - /srv/dev-disk-by-uuid-129ba3c6-37fd-4ee3-ad98-3e0358075b93f/Appdata/xteve/temp:/tmp/xteve
    image: 'dnsforge/xteve'
    labels: 
      - autoheal=0
    healthcheck:
      test: curl -fSs http://127.0.0.1:34400 || exit 1
      start_period: 180s
      timeout: 10s
      interval: 10s
      retries: 3
    restart: unless-stopped

I have the files created for appdata/xteve/config though cannot figure out what i am doing wrong only a few weeks into using any yaml, i understand from google its maybe to do with the indentations.

Any help would be much appreciated.

This is the original template –

 xteve:
    container_name: xteve
    environment:
      - PUID=$PUID
      - PGID=$PGID
      - TZ=$TIME_ZONE
    ports:
      - 34400:34400
    volumes:
      - $PERSIST/xteve:/home/xteve/conf
      - $PERSIST/xteve/temp:/tmp/xteve
    image: 'dnsforge/xteve'
    labels: 
      - autoheal=$AUTOHEAL_RESTART
    healthcheck:
      test: curl -fSs http://127.0.0.1:34400 || exit 1
      start_period: 180s
      timeout: 10s
      interval: 10s
      retries: 3
    restart: unless-stopped
1 Like

This is not a valid compose file, it lacks the top level services declaration:

services:
  xteve:
    ...

It you use the docker-compose (=v1.x) command instead of the docker compose (=v2.x) command, you might need to use the top level 'version` declaration as well. Recent versions of both shouldn’t require version anymore, older versions of v1.x do.

In case of doubt, always consult the compose specification to see what configuration keys exist and how they are supposed to be used:: Compose specification | Docker Documentation

1 Like

Suggestion to Docker team - make it say this. The current error message has very low probability of putting the recipient on the correct path.

Edit: In my case it lead my astray because I didn’t notice I had just failed to copy and paste this in.

2 Likes

Hey new suggestion. Why don’t you just say the one and only way and don’t waste the time of people googling around about things they just want to learn but do not understand because there are 17k ways to achieve a simple task. just say…hey guys if you want to specify a volume on docker just do this. Instead you are suggesting a lot of ways and things and some magic mayby some mushrooms and some other drugs to understand what kind of thing we want to do with volumes and maybe we are just on some weird drugs there is always a solution which is not documented and which is not really recommended. Just do it one way and document it and everybody is happy.

1 Like