skip to Main Content

In my ubuntu 22.04 with a docker compose version v2.17.2, when I try to execute the command docker compose up I receive this error:

XXXX@ubuntu:/develop/composetest$ docker compose up
no configuration file provided: not found

I’m in a folder with a compose.yaml file:

version: "3"
services:
  web:
    build: .
    ports:
      - "8000:5000"
  redis:
    image: "redis:alpine"

If can help, I try whith this command:

docker compose -f compose.yaml up

And result is:

stat /var/lib/snapd/void/compose.yaml: no such file or directory

How can I solve it?
thanks

2

Answers


  1. The default name of configuration yaml for docker compose is docker-compose.yml. You can rename compose.yaml to docker-compose.yml and run docker compose up directly.

    If you want to use another file name:

    • Use .yml instead of .yaml
    • Add relative path to command: docker compose -f ./compose.yml up
    Login or Signup to reply.
  2. I am also having this issue. I’m trying to create HomeAssistant. My files exist & are spelled correctly.

    avp@minion-1:/opt$ docker compose version
    Docker Compose version v2.20.3
    avp@minion-1:/opt$ cd homeassistant/
    avp@minion-1:/opt/homeassistant$ ls -l
    total 12
    -rw-r–r– 1 root root 324 Mar 3 18:19 compose.yml
    drwxr-xr-x 2 root root 4096 Mar 3 18:00 config
    -rw-r–r– 1 root root 324 Mar 3 18:14 docker-compose.yml
    avp@minion-1:/opt/homeassistant$ sudo docker compose up -d
    no configuration file provided: not found

    Thanks in advance.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search