Docker Compose prompted error: no configuration file provided: not found
Asked Answered
M

12

99

I had setup Docker Desktop with Windows WSL integration version 2 and I run into issue when execute certain docker compose command with following errors

docker compose logs
no configuration file provided: not found

However, there were no problem found when executing the following

docker compose up

and image built and fired up successfully.

Is there anyone who can help with this?


Output of docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.7.1)
  compose: Docker Compose (Docker Inc., v2.2.1)
  scan: Docker Scan (Docker Inc., 0.9.0)

Server:
 Containers: 3
  Running: 3
  Paused: 0
  Stopped: 0
 Images: 4
 Server Version: 20.10.11
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc version: v1.0.2-0-g52b36a2
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.60.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 24.95GiB
 Name: docker-desktop
 ID: FUMA:ZOXR:BA4L:YSOZ:4NQT:HHIZ:ASAD:EJGA:NJRG:SO4S:GXN3:JG5H
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support

UPDATED

It was my mistake that I should execute the docker compose command under the correct directory where docker-compose.yml file located at.

The issue is resolved.

Mushy answered 7/12, 2021 at 8:24 Comment(1)
Try to specify the compose file path like this docker-compose -f <docker-compose.yml> logsJunket
M
68

execute docker-compose command where docker-compose.yml file located at should resolved it.

or specify the docker-compose.yml file as bellow

docker-compose -f <docker-compose.yml> logs 

as suggested

Mushy answered 7/12, 2021 at 9:10 Comment(2)
I copied an old example without the yml extension (I guess once upon a time it wasn't needed). Adding it worked.Clementia
This fixed it for me. I had made the noob mistake of thinking that 'docker compose down' would bring down whatever was running from the dir I was in - which it will if your compose file has the default name of 'docker-compose.yml' but it won't if your compose file is called something else.Swaine
T
9

For anyone who's getting

no configuration file provided: not found

I was getting the same message on Mac trying to execute

docker-compose up

The problem was with docker-compose.yml file. I saved it from Visual Studio Code as a text file though OS determined it like a proper YAML file. Look at the screenshot: left file is wrong but seems the same.

enter image description here

Make sure you select YAML format when you saving it.

enter image description here

Tiddly answered 15/6, 2022 at 12:44 Comment(0)
A
6

Just had the very same issue on Ubuntu 22.04.3 LTS (Jammy) with a minimal server install that had the "docker" checked during the installation. It appears that the installer choose to install the snap version of docker, resulting in this error:

root@server:/srv/project# docker compose -f docker-compose.yml up
stat /var/lib/snapd/void/docker-compose.yml: no such file or directory

I removed the snap version (snap remove docker), then followed the official installation steps and added the compose plugin (apt install docker-compose). I needed to remove the link to the snap binary (rm /snap/bin/docker) and updated my PATH (as in a logout / login) and voilà.

Assimilative answered 4/1, 2024 at 13:42 Comment(2)
This was my issue. Removing the snap version and reinstalling fixed it for me. Thanks!Dee
For me the reason was that I used the -f file option after the up/down command. It must be used beforePeriodicity
Z
2
  1. Docker Compose version v2.17.2
  2. Docker version 24.0.5, build ced0996
  3. Ubuntu 22.04.3 LTS

In my case the problem was that from some point the command became docker compose, but not docker-compose. So the valid command is docker compose up -d.

https://docs.docker.com/compose/migrate/

Zymo answered 18/8, 2023 at 21:1 Comment(0)
E
2

My configuration:

  • Ubuntu Server 22.04.4 LTS
  • Docker installed via snap

Solution

Move docker-compose.yml file under a user home directory (ie /home/user/plex) and run docker compose up -d in this directory.

Additional Context

I was originally planning to aggregate all my containers into /opt/stacks Referencing compose files outside a user home directory results in the error message even if you use a fully qualified path (-f option)

European answered 16/3, 2024 at 1:33 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Grays
C
1

In my case, I spelt the file wrongly. I used=> docker.compose.yml rather than=> docker-compose.yml

so check the spelling of the file. it must match the command

Catharina answered 24/12, 2023 at 16:2 Comment(0)
A
0

I was facing the same issue on Windows PowerShell . I was using the docker-compose up command from within the newly created directory located in C:\WINDOWS\system32\ .

In my case, I rectified the problem by moving it to C:\Users\

Afloat answered 7/1, 2022 at 4:36 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Grays
C
0

Faced the same issue on a Windows PC. The problem was with the extension of the file being assumed by the OS as a known file type.

Solution

Go to Folder options and disable the Hide extensions for known file types.

You should be able to see the actual file extension which may looked like proper .txt files now (instead of .yml). Rename the file(s) accordingly, run the command again and viola!

enter image description here

Chirrupy answered 12/10, 2022 at 9:36 Comment(0)
E
0

I was getting the similar error on windows 10 and corrected the same by saving my .yaml file again with type as "All files" and extension as .yaml. Before this windows was saving it as text file due to which it was giving error.

Emanative answered 10/3, 2023 at 8:12 Comment(0)
D
0

I was facing the same issue (while trying to view logs from all services in a compose file) and the top answer here solved it for me with just a small variation.

  • I had a custom docker-compose file (for example, docker-compose.custom.yml)
  • I had to use "docker compose" instead of "docker-compose"

So the below command worked for me:

docker compose -f docker-compose.custom.yml logs --follow
Deeannadeeanne answered 26/10, 2023 at 14:27 Comment(0)
M
0

for those who may have an issue with Error response from daemon: Conflict. The container name "db" is already in use by container "id". You have to remove (or rename) that container to be able to reuse that name.

  1. check to see which container running on your machine docker ps -a
  2. delete the desired container docker rm [contianer name]
  3. create the container new docker compose -f [where docker data located]/[docker yml file] up --force-recreate --build -d
Matthewmatthews answered 5/2, 2024 at 11:30 Comment(0)
A
-3

I was also receiving this error and I had mis-spelt the file name(oops), so also double check spelling of files if anyone else finds their way to this post!

Aerial answered 7/3, 2022 at 11:17 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.