Ubuntu cannot find docker-compose.yml

Hi Folks,

When trying to create a docker container on Ubuntu 22 I am unable to run docker compose up -d, it continually fails with:

no configuration file provided: not found

The docker-compose.yml file does exist and I am in the same folder when I run the docker compose command.

Any ideas??

Thx

Mike

Hi Mike,

Have you solved this issue because I have the same problem and I have tried to do everything with no success, please?

Sanyi

Hard to help when all you share is that you have an error message and basically say that it’s wrong. It is probably not, but I guess this is the reason why the original question didn’t get any response.

The filename is probably wrong. For example it could be lowercase ymI instead of yml. The first ends with uppercase i and the latter with a lowercase L. You could do th following:

  1. Try to use cat to get the content of the file, but when you refer to the filename, don’t use TAB to complete the name in the terminal.
    cat docker-compose.yml
    
  2. If that works, then you can specify the compose file as a compose argument:
    docker compose -f docker-compose.yml up -d
    
  3. You ca also check the length of the filename like this:
    find * | awk '{print length "\t" $0}'
    
    and you should get an output like this but different depending on what files you have in the folder:
    18	docker-compose.yml
    6	run.sh
    
    If you don’t see 18 before the compose file’s name there is an extracharacter in it or something is missing.

Dear Ákos,
Yes, you are right but I am totally new on this area. Well, I was succeded to overcome tis error. First it was a problem I wrote ‘docker compose’ instead of ‘docker-compose’ and then I gave the docker-compose.yml file location with -f option.
Now it is working.
Thank you for answering me.
Bests,
Sanyi