ERROR: The Compose file './docker-compose.yml' is invalid because:
Invalid top-level property "True". Valid top-level sections for this Compose file are: version, services, networks, volumes, secrets, configs, 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/
解決方案:
全選復(fù)制的時候粘貼yml文件的時候可能存在丟字段的問題,我的是把頂部的版本丟了
可以分段復(fù)制粘貼。我是這樣解決的文章來源:http://www.zghlxwxcb.cn/news/detail-621401.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-621401.html
到了這里,關(guān)于docker-compose.yml報錯問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!