如何使用自定义文件名运行 docker-compose [重复]

问题描述 投票:0回答:1

我有这个文件:

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

是否有一些选项可以指定使用哪个文件?

docker docker-compose
1个回答
80
投票

使用

-f
选项指定文件名。

示例:

docker compose -f docker-compose.test.yml up
© www.soinside.com 2019 - 2024. All rights reserved.