Yome
Yome

Reputation: 299

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

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

Upvotes: 25

Views: 33716

Answers (6)

Bartek
Bartek

Reputation: 1

Be sure that you are in good directory. In my case cd to folder with .yml was helpful

Upvotes: 0

Shrm
Shrm

Reputation: 453

The same as the others, my issue was solved by restarting the service using: docker compose restart

Upvotes: 0

k_o_
k_o_

Reputation: 6298

I had switched to a different git branch where the deployment files where missing. Later I switched back to my branch including it. Linux has lost the file reference and did not see the files anymore. ls was not showing anything. I had to leave the directory and enter it again. Then docker-compose could find the files again.

Upvotes: 0

Lyman Meng
Lyman Meng

Reputation: 21

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

downloading

Upvotes: 2

gekh
gekh

Reputation: 2122

In my case, I forgot to start Docker itself.

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

Upvotes: 34

Capripot
Capripot

Reputation: 1519

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

Upvotes: 3

Related Questions