docker-compose ERROR: .FileNotFoundError: [Errno 2] No such file or directory:

Viewed 21880

So when i run the command,

docker-compose -f config/somefile.yml up -d

I get the following error: ERROR: .FileNotFoundError: [Errno 2] No such file or directory: ./config/somefile.yml

I tried giving the full path to the yml file, but the error is the same.

However, when i create a dulicate file with the name docker-compose.yml (by using, script: cp somefile.yml docker-compose.yml) and then i run

docker-compose up

It runs fine. It just cannot run any other file than the default one. Ive searched a lot of places and could not find any solution. Any help will be greatly appreciated. Thanks

Docker-compose: 1.22 O.S: Ubuntu 14.4

3 Answers

In my case, I forgot to start Docker itself.

So, check if you've started the Docker application before executing docker-compose.

The file is probably not there.

One way to make sure the tool is not to blame, is to use another basic command like cat.

$ cat ./config/somefile.yml
cat: ./config/somefile.yml: No such file or directory

For me, restarting both the Docker app and terminal worked.

downloading

Related