compose icon indicating copy to clipboard operation
compose copied to clipboard

docker-compose -f /my/path/docker-compose.yml - No such file or directory

Open samber opened this issue 10 years ago • 31 comments

Hi guys !

When doing a docker-compose -f /a/b/c/docker-compose.yml pull from /a -> it works. When doing a docker-compose -f /a/b/c/docker-compose.yml pull from /a/foo/bar -> it does not work:

ERROR: .IOError: [Errno 2] No such file or directory: '/a/b/c/docker-compose.yml'

Didn't investigate more on this problem.

$ docker-compose  version
docker-compose version 1.8.0, build f3628c7
docker-py version: 1.9.0
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2h  3 May 2016

samber avatar Aug 25 '16 09:08 samber

Having the same probleme here. Any news on this?

mikygit avatar Sep 19 '16 08:09 mikygit

+1, met same issue on 1.8.0 version

jraduget avatar Oct 05 '16 14:10 jraduget

Same issue.

Docker version: 1.12.5 docker-compose version: 1.9.0

How to reproduce:

cd /home/userBBB/
docker-compose -f /home/userAAA/subdir/test.yml up -d
# ERROR: .IOError: [Errno 2] No such file or directory: '/home/userAAA/subdir/test.yml'

cd /home/userAAA/
docker-compose -f /home/userAAA/subdir/test.yml up -d
# it works

It is NOT a premissions problem on /home/userAAA/subdir/test.yml or any part of the path (i checked this).

coolcow avatar Jan 26 '17 18:01 coolcow

Same problem here, v1.8.0 build f3628c7.

yaroslav-shabalin avatar Jan 28 '17 14:01 yaroslav-shabalin

Same problem here, I saw it when I added a systemctl service and it fails to run in system boot with this message.

chrisvel avatar Jul 29 '17 08:07 chrisvel

Same problem, it's really weird. I've no clue why that's not working.

Version 17.11.0-ce-rc3-mac38 (20152)
Channel: edge
a091b4ad0a

amansilla avatar Nov 17 '17 09:11 amansilla

Same problem here... Someone solved this? Pliz share :(

i'm on windows and that's my docker version:

$ docker-compose version
docker-compose version 1.16.1, build 6d1ac219
docker-py version: 2.5.1
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016

rafadpedrosa avatar Nov 22 '17 19:11 rafadpedrosa

My problem seems to be an issue using many files...

i'm not that good in docker and i really don't know how to solve this. Even because i'm using laradock and it has a lot of things on it that i don't understand.

Any way, when i remove the bold text, it runs.

COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml

But it feels wrong. I'm going to downgrade docker version tomorrow and see how it works.

rafadpedrosa avatar Nov 22 '17 20:11 rafadpedrosa

Getting the same thing as @rafadpedrosa, thanks for the solution!

Don't really know docker yet though so not sure if this is an issue.

stevebauman avatar Nov 28 '17 15:11 stevebauman

@samber @coolcow trying to reproduce but can't. Can you elaborate test steps pls?

@coolcow I can't see what is different between these two cd /home/userBBB/ docker-compose -f /home/userAAA/subdir/test.yml up -d # ERROR: .IOError: [Errno 2] No such file or directory: '/home/userAAA/subdir/test.yml'

cd /home/userAAA/ docker-compose -f /home/userAAA/subdir/test.yml up -d # it works

Mat001 avatar Apr 18 '18 21:04 Mat001

Was able to reproduce. Works for me.

Ubuntu Linux, docker-compose version 1.21.0-rc1, build 1d32980 docker-py version: 3.2.1 CPython version: 3.6.4 OpenSSL version: OpenSSL 1.0.1t 3 May 2016

m@m:~/userBBB$ docker-compose -f /home/m/userAAA/subdir/docker-compose.yml up -d Starting subdir_web_1 ... done Starting subdir_redis_1 ... done

Mat001 avatar Apr 19 '18 16:04 Mat001

@samber Hey, could we close this issue? It seems it has been resolved. Works for me. Can you try again and then close it?

Mat001 avatar Apr 19 '18 16:04 Mat001

@Mat001 Cannot reproduce this bug with docker-compose 1.20.1.

Thanks to whoever fixed that ;)

samber avatar Apr 19 '18 20:04 samber

I have the same problem

docker-compose version 1.22.0, build f46880fe docker-py version: 3.4.1 CPython version: 3.6.6 OpenSSL version: OpenSSL 1.1.0f 25 May 2017

(18-10-05 0:56:06) <0> [/] ocker-compose -f /tmp/tmpfRtJlW/docker-compose.yaml up --build --abort-on-container-exit ERROR: .FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpfRtJlW/docker-compose.yaml'

(18-10-05 1:03:58) <0> [/tmp] docker-compose -f /tmp/tmpfRtJlW/docker-compose.yaml up --build --abort-on-container-exit Working!

simonloveslife avatar Oct 05 '18 01:10 simonloveslife

It works for me (OSX, 1.22).

samber avatar Oct 05 '18 06:10 samber

@samber Thanks for confirming, do you think that's because I use an old docker? Client: Version: 1.12.6 API version: 1.24 Go version: go1.6.3 Git commit: 7392c3b/1.12.6 Built: Thu Jan 26 09:26:48 2017 OS/Arch: linux/amd64

Server: Version: 1.12.6 API version: 1.24 Go version: go1.6.3 Git commit: 7392c3b/1.12.6 Built: Thu Jan 26 09:26:48 2017 OS/Arch: linux/amd64

simonloveslife avatar Oct 05 '18 18:10 simonloveslife

Yes, maybe...

But I think this issue was for docker-compose, not docker engine.

Anyway, using an old docker-compose version with a recent docker engine does not guaranty that everything is working well! At that time, Docker retro-compatibility was not very nice :-(.

samber avatar Oct 05 '18 19:10 samber

My pc docker compose current versionis 1.22.0 how can i downgrade it to 1.20.0 where i wont reproduce that error?

mallikarjunasai995 avatar Oct 17 '18 14:10 mallikarjunasai995

Hi guys I'm getting this error while giving command can someone help in this... docker error

THanks in advance

kamalrajs65 avatar Nov 02 '18 05:11 kamalrajs65

Any follow up on this? I've spend a lot of time with this lately, but it seems like the -f option to docker-compose is rather useless, or at least misleading. As is the error message.

It seems natural to have one docker-compose file in a central location that starts multiple containers from multiple directories (each in different repositories).

Not sure if my problem is actually related to this Issue or not because the error is extremely unhelpful.

wtgee avatar Jun 18 '19 00:06 wtgee