Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker-compose can't find suitable file, even though it exists

So I am running ubuntu 18.04 lts on windows 10 through hyper-v and I'm trying to run the docker compose command through the terminal. When inside the docker folder and I run ls, it says there is a docker-compose.yml file. Still when I run docker compose command, it says no suitable configuration file is found.

docker-compose up -d
ERROR: 
    Can't find a suitable configuration file in this directory or any
    parent. Are you in the right directory?

    Supported filenames: docker-compose.yml, docker-compose.yaml

I'm using docker version 18.09.0 and docker compose version 1.22.0

like image 252
jemoeee Avatar asked Nov 14 '18 16:11

jemoeee


2 Answers

On Ubuntu Ubuntu 18.04.2 LTS I was facing the same issue. I don't know the exact reason but Docker and Docker Compose installed with snap was not working.

sudo snap remove docker && sudo snap remove docker-compose

Installed docker from Officials Docs here and compose from here via apt and and now my Docker Compose file start working

like image 132
Vaseem007 Avatar answered Sep 23 '22 00:09

Vaseem007


Found out the problem was using shared folder functionality with Hyper V and windows 10. For some reason docker won't work when the docker-compose.yml file is located inside that, however when I move it outside of the shared(e.g. home directory) folder it does work. So if I want to use the docker file I have to place it outside the shared folder to make it work. Rest of the project runs as expected, so a little workaround ......

like image 27
jemoeee Avatar answered Sep 24 '22 00:09

jemoeee