如何查看docker-compose.yml所在位置
作者:HellHellNo
查看docker-compose.yml所在位置
前提要开启docker
locate docker-compose.yml
docker-compose.yml报错
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/
解决方案
全选复制的时候粘贴yml文件的时候可能存在丢字段的问题,我的是把顶部的版本丢了
可以分段复制粘贴。我是这样解决的
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。