74

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 can help on this?

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 resolved

Gan Yi Zhong
  • 1,391
  • 1
  • 9
  • 9

8 Answers8

55

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

Gan Yi Zhong
  • 1,391
  • 1
  • 9
  • 9
  • I copied an old example without the yml extension (I guess once upon a time it wasn't needed). Adding it worked. – Rob Sedgwick Jan 11 '22 at 20:33
  • 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. – trapper_hag Aug 25 '22 at 09:50
5

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

Viktor Born
  • 186
  • 1
  • 5
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\

Abhishek Dutt
  • 1,308
  • 7
  • 14
  • 24
A.Biswas
  • 1
  • 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](/help/how-to-answer). – Community Jan 07 '22 at 13:48
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

Ahmad Baktash Hayeri
  • 5,802
  • 4
  • 30
  • 43
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.

pndey
  • 71
  • 4
0
  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/

Potato
  • 397
  • 4
  • 16
-1

Create the following docker-compose.yaml file in an empty directory of your choice

Shabeer K
  • 1,489
  • 16
  • 23
-2

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!