如何使用自定义文件名运行docker-compose
我有这个文件: docker-compose.test.yml
但是当我尝试运行时docker-compose,会发生这种情况:
$ docker-compose up
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
是否有一些选项可以指定要使用的文件?
回答
使用-f选项指定文件名。
例子:
docker-compose -f docker-compose.test.yml up