Doug
Doug

Reputation: 15523

docker-compose logs with separate yml file

How do I run docker-compose logs but using a separate yaml config?

For example, if I want to run docker-compose up with a separate file, I can do:

docker-compose -f other-config.yml up

But -f in docker-compose logs points to a service, rather than a file.

Upvotes: 1

Views: 723

Answers (1)

Mihai
Mihai

Reputation: 10757

For docker-compose, the -f options means to load a different configurations file. for docker-compose logs, the -f option means to follow the logs.

For your situation you need to pass the -f option twice:

docker-compose -f other-config.yml logs -f

You can optionally specify a service name as well at the end.

Upvotes: 3

Related Questions