ERROR: Version in "./docker-compose.yml" is unsupported. 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/
错误原因:------> docker-compose版本过低
解决方式:
一、调整文件中的版本要求
直接改成3.3 或者你保存信息中提到的版本号
二、升级docker-compose
查看版本路径
首先要查看docker-compose的路径文章来源:https://www.toymoban.com/news/detail-590090.html
# docker-compose -v
docker-compose version 1.18.0, build 8dd22a9
# whereis docker-compose
docker-compose: /usr/bin/docker-compose
升级
根据上一步的whereis
找到了docker-compose的路径为:/usr/bin/docker-compose
,所以下面的脚本,路径也替换为这个就可以了。文章来源地址https://www.toymoban.com/news/detail-590090.html
下载
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.10.2/docker-compose-`uname -s`-`uname -m` > /usr/bin/docker-compose
授权
# chmod +x /usr/bin/docker-compose
测试
版本号查看
# docker-compose -v
到了这里,关于ERROR: Version in “./docker-compose.yml“ is unsupported的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!