Docker撰写版本不受支持

时间:2020-03-26 08:47:18

标签: docker docker-compose

我正在使用version: '3'进行docker-compose,可以在主机(macOS)上正常工作,但是当我尝试构建映像并在服务器中运行容器时,得到了响应

Version in "./docker-compose.dev.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") 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/
OS Ubuntu "16.04.6 LTS (Xenial Xerus)" in AWS (ec2)
Docker version 19.03.8
docker-compose version 1.8.0, build unknown

我找到了解决方法,那就是使用版本2 ,我该如何解决呢?

0 个答案:

没有答案