title: docker-compose: Compose file "..." is invalid because: unsupported config options
body: <p>I have recently pulled an <a href="https://github.com/docker/awesome-compose" rel="nofollow noreferrer">official repository</a> from docker consisting of docker-compose templates.</p>
  <p>When I try to build and run <em><strong>nginx-golang-mysql/docker-compose.yml</strong></em> with <em><strong>docker-compose up -d</strong></em> I get the following error:</p>
  <pre><code>ERROR: The Compose file './docker-compose.yaml' is invalid because:
  Unsupported config option for volumes: 'db-data'
  Unsupported config option for secrets: 'db-password'
  Unsupported config option for services: 'proxy'
  </code></pre>
  <p>This is my <code>docker-compose.yml</code> file (<a href="https://github.com/docker/awesome-compose/blob/master/nginx-golang-mysql/docker-compose.yaml" rel="nofollow noreferrer">original available on github</a>):</p>
  <pre class="lang-yaml prettyprint-override"><code>services:
    backend:
      build: backend
      secrets:
        - db-password
      depends_on:
        db:
          condition: service_healthy
    db:
      # We use a mariadb image which supports both amd64 &amp; arm64 architecture
      image: mariadb:10.6.4-focal
      # If you really want to use MySQL, uncomment the following line
      #image: mysql:8.0.27
      command: '--default-authentication-plugin=mysql_native_password'
      restart: always
      healthcheck:
        test: [&quot;CMD&quot;, &quot;mysqladmin&quot;, &quot;ping&quot;, &quot;-h&quot;, &quot;127.0.0.1&quot;, &quot;--silent&quot;]
        interval: 3s
        retries: 5
        start_period: 30s
      secrets:
        - db-password
      volumes:
        - db-data:/var/lib/mysql
      environment:
        - MYSQL_DATABASE=example
        - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
      expose:
        - 3306
    proxy:
      build: proxy
      ports:
        - 80:80
      depends_on: 
        - backend
  volumes:
    db-data:
  secrets:
    db-password:
      file: db/password.txt
  </code></pre>
  <p>These are my versions of <code>docker</code> and <code>docker-compose</code>:</p>
  <pre><code>Docker version 20.10.13, build a224086
  docker-compose version 1.25.0, build unknown
  </code></pre>
  <p>Any idea why I'm getting these errors? The other compose-files throw a similar error when I try to run them. I'm using this version of Docker and docker-compose for other projects successfully on a daily basis.</p>