MMEL
MMEL

Reputation: 358

path to "docker-compose.yml" as a parameter

Today in order to launch my docker containers specified/included in my docker-compose.yml file, I first go to the folder where the docker-compose.yml is located and then I type:

docker-compose up -d

and it works very well!

WHAT IF I wish to run that "docker-compose up" command from a different folder (not from inside the folder where docker-compose.yml is located):

I tried:

docker-compose up -d -f /data/....../docker-compose.yml

but that did not work as I received a warning that did redisplay all the possible options and "-f" was not 1 of of the option listed.

So how do I specify a path to "docker-compose.yml" as a CLI parameter to my "docker-compose up" command ?

Upvotes: 4

Views: 4504

Answers (1)

TylerLubeck
TylerLubeck

Reputation: 648

docker-compose is pretty picky about which parts of the command take options. In this case, docker-compose up doesn't take a -f option.

However, docker-compose itself does take a -f option. Try running:

docker-compose -f /data/......./docker-compose.yml up -d

Upvotes: 9

Related Questions