Docker can’t find a Compose file in the directory where you ran the command, so it bails out with
no configuration file provided: not found
What Compose looks for by default
In the current working directory it tries (in this order):
docker-compose.yaml
docker-compose.yml
compose.yaml
compose.yml
If none of those files exist, you get the error you’re seeing.
How to fix it
✅ 1. Make sure you are in the directory that actually contains the Compose file.
cd /path/to/project-root # the directory that holds docker-compose.yml
docker compose up --build
✅ 2. Check the file name / extension.
ls -1
# should list something like:
# docker-compose.yml
# or docker-compose.yaml
If you accidentally named it docker-compose.json or docker-compose, rename it to .yml or .yaml.
✅ 3. Point Compose to the file explicitly.
If your compose file lives somewhere else or has a custom name:
docker compose -f /path/to/my-compose-file.yml up --build
✅ 4. Verify you’re using the command that matches your installation.
• Docker Compose V2 (the plugin) ➜ docker compose ... (space)
• Docker Compose V1 (the Python package) ➜ docker-compose ... (dash)
Either form works as long as you’re consistent, but the error message you posted is characteristic of the V2 plugin.
Quick sanity check
docker compose version # or: docker-compose --version
If that prints a version and you still get the “no configuration file” error, the problem is definitely that there’s no properly-named compose file in the directory.
Example minimal compose file
Just to be sure your setup works, drop this into docker-compose.yml in an empty folder and run docker compose up --build again:
services:
hello:
image: alpine:3.19
command: [ "echo", "Hello from Docker Compose!" ]
You should see the “Hello from Docker Compose!” message in the logs, confirming everything is working.
Summary
Place a correctly-named docker-compose.yml (or one of the accepted alternatives) in the directory where you execute the command, or supply the file via -f. Once Compose can see the file, the docker compose up --build command will proceed normally.