问答详情
源自:6-3 compose实战

docker-compose up -d 出错 各位版本数字都是试了,就是不行

The Compose file './docker-compose.yml' is invalid because:

Invalid top-level property "db". Valid top-level sections for this Compose file are: version, services, networks, volumes, and extensions starting with "x-".


You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.

For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/


提问者:慕仰8382726 2019-04-17 17:22

个回答

  • dabo
    2019-04-19 00:19:23

    db 的缩进不对,它提示你:
    Invalid top-level property "db"

    db 应该在 services 下