How to run docker-compose with custom file name

Viewed 13323

I have this file: docker-compose.test.yml

But when I try to run docker-compose, this happens:

$ 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

Is there some option to specify which file to use?

1 Answers

Use -f option to specify the file name.

Example:

docker-compose -f docker-compose.test.yml up
Related