[GH-ISSUE #299] Docker composer can not build the image using official steps #174

Closed
opened 2026-02-22 18:18:12 -05:00 by yindo · 9 comments
Owner

Originally created by @franciscopaniskaseker on GitHub (Oct 27, 2023).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/299

I am following this doc: https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/HOW_TO_USE_DOCKER.md

about the step:
yarn setup
Not sure if is asking to setup yarn or to execute yarn setup in the root directory. i did both:

apt -y install yarn
root@:~/anything-llm# yarn setup
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'setup'

Then I tried to build:

root@:~/anything-llm/docker# docker-compose up -d --build
ERROR: The Compose file './docker-compose.yml' is invalid because:
'name' does not match any of the regexes: '^x-'

You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

i did the clone today, so the first lines of composer files are:

version: '3.9'

name: anythingllm

So i removed the line "name" and did:

export COMPOSE_PROJECT_NAME=anythingllm
docker-compose up -d --build

and the bulding process started to work.

Seems that the docker situation is something related with composer version, I am not sure. What I am sure is folowing the official steps to build the image will not work (at least with recent docker composer version).

Originally created by @franciscopaniskaseker on GitHub (Oct 27, 2023). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/299 I am following this doc: https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/HOW_TO_USE_DOCKER.md about the step: `yarn setup ` Not sure if is asking to setup yarn or to execute yarn setup in the root directory. i did both: ``` apt -y install yarn root@:~/anything-llm# yarn setup 00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'setup' ``` Then I tried to build: ``` root@:~/anything-llm/docker# docker-compose up -d --build ERROR: The Compose file './docker-compose.yml' is invalid because: 'name' does not match any of the regexes: '^x-' You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1. For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/ ``` i did the clone today, so the first lines of composer files are: ``` version: '3.9' name: anythingllm ``` So i removed the line "name" and did: ``` export COMPOSE_PROJECT_NAME=anythingllm docker-compose up -d --build ``` and the bulding process started to work. Seems that the docker situation is something related with composer version, I am not sure. What I am sure is folowing the official steps to build the image will not work (at least with recent docker composer version).
yindo added the question label 2026-02-22 18:18:12 -05:00
yindo closed this issue 2026-02-22 18:18:13 -05:00
Author
Owner

@timothycarambat commented on GitHub (Oct 27, 2023):

What version of docker-compose are you running?
docker-compose -v

Locally I'm on Docker Compose version v2.10.2

@timothycarambat commented on GitHub (Oct 27, 2023): What version of `docker-compose` are you running? `docker-compose -v` Locally I'm on `Docker Compose version v2.10.2`
Author
Owner

@timothycarambat commented on GitHub (Oct 27, 2023):

For the yarn command you are running the setup command in the root package.json. So the expanded command is yarn run setup while in the project root.

@timothycarambat commented on GitHub (Oct 27, 2023): For the yarn command you are running the `setup` command in the root `package.json`. So the expanded command is `yarn run setup` while in the project root.
Author
Owner

@timothycarambat commented on GitHub (Oct 27, 2023):

Additionally, are you sure you installed yarn and not cmdtest
See how to fix: https://github.com/yarnpkg/yarn/issues/3708#issuecomment-317358958

@timothycarambat commented on GitHub (Oct 27, 2023): Additionally, are you sure you installed `yarn` and not `cmdtest` See how to fix: https://github.com/yarnpkg/yarn/issues/3708#issuecomment-317358958
Author
Owner

@franciscopaniskaseker commented on GitHub (Oct 28, 2023):

root@ip-172-31-47-141:~# docker-compose -v
docker-compose version 1.29.2, build unknown

however, at the same time, the plugin version is:
docker-compose-plugin is already the newest version (2.21.0-1~ubuntu.22.04~jammy).

For the yarn command you are running the setup command in the root package.json. So the expanded command is yarn run setup while in the project root.

root@:~/anything-llm# yarn run setup
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'

Additionally, are you sure you installed yarn and not cmdtest

Not sure how to test if is cmdtest or not. what I did, then:

apt remove yarn cmdtest
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn

these are official steps from yarn official site.

then I tried:

root@:~/anything-llm# yarn run setup
yarn run v1.22.19
error anything-llm@0.2.0: The engine "node" is incompatible with this module. Expected version ">=18". Got "12.22.9"
error Commands cannot run with an incompatible environment.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

So seems that cmdtest was installed. Now i need to upgrade the node version:

apt install npm
npm install -g n
n latest

root@:~/anything-llm# node --version
v21.1.0

Now the command
yarn run setup

executed as expected. Now I build the docker image again and seems that worked. I will try to use.

@franciscopaniskaseker commented on GitHub (Oct 28, 2023): ``` root@ip-172-31-47-141:~# docker-compose -v docker-compose version 1.29.2, build unknown ``` however, at the same time, the plugin version is: `docker-compose-plugin is already the newest version (2.21.0-1~ubuntu.22.04~jammy).` > For the yarn command you are running the setup command in the root package.json. So the expanded command is yarn run setup while in the project root. ``` root@:~/anything-llm# yarn run setup 00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run' ``` > Additionally, are you sure you installed yarn and not cmdtest Not sure how to test if is cmdtest or not. what I did, then: ``` apt remove yarn cmdtest curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt update && sudo apt install yarn ``` these are official steps from yarn official site. then I tried: ``` root@:~/anything-llm# yarn run setup yarn run v1.22.19 error anything-llm@0.2.0: The engine "node" is incompatible with this module. Expected version ">=18". Got "12.22.9" error Commands cannot run with an incompatible environment. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ``` So seems that cmdtest was installed. Now i need to upgrade the node version: ``` apt install npm npm install -g n n latest root@:~/anything-llm# node --version v21.1.0 ``` Now the command `yarn run setup ` executed as expected. Now I build the docker image again and seems that worked. I will try to use.
Author
Owner

@bryceartstew commented on GitHub (Oct 28, 2023):

I encountered the same issue, what was your exact fix?

I receive this error when I attempt to build the docker

ERROR: The Compose file './docker-compose.yml' is invalid because:
'project-name' does not match any of the regexes: '^x-'

You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

@bryceartstew commented on GitHub (Oct 28, 2023): I encountered the same issue, what was your exact fix? I receive this error when I attempt to build the docker ERROR: The Compose file './docker-compose.yml' is invalid because: 'project-name' does not match any of the regexes: '^x-' You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1. For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
Author
Owner

@timothycarambat commented on GitHub (Oct 28, 2023):

@bryceartstew I was going to close this thread, but in general - that issue sounds like your install of docker-compose is not able to read the specific YAML we have defined. So I would start there if the Dockerfile cannot even be parsed!

@timothycarambat commented on GitHub (Oct 28, 2023): @bryceartstew I was going to close this thread, but in general - that issue sounds like your install of docker-compose is not able to read the specific YAML we have defined. So I would start there if the Dockerfile cannot even be parsed!
Author
Owner

@franciscopaniskaseker commented on GitHub (Oct 30, 2023):

@bryceartstew i removed that line and did:
export COMPOSE_PROJECT_NAME=anythingllm

@franciscopaniskaseker commented on GitHub (Oct 30, 2023): @bryceartstew i removed that line and did: `export COMPOSE_PROJECT_NAME=anythingllm `
Author
Owner

@franciscopaniskaseker commented on GitHub (Oct 30, 2023):

After correctly image build process (according official steps), we still can not use the anythingllm:
Screenshot 2023-10-30 at 09 03 15

For now the dev will stop to try anythingllm. Too much problems. we expect something easier from docker image. thank you all.

@franciscopaniskaseker commented on GitHub (Oct 30, 2023): After correctly image build process (according official steps), we still can not use the anythingllm: ![Screenshot 2023-10-30 at 09 03 15](https://github.com/Mintplex-Labs/anything-llm/assets/8779476/435fc49d-7bc6-49d3-9a2a-68b1b7cac602) For now the dev will stop to try anythingllm. Too much problems. we expect something easier from docker image. thank you all.
Author
Owner

@timothycarambat commented on GitHub (Oct 30, 2023):

For what it's worth, it's because you have incorrect permissions on the database file in the host machine and docker cannot write to it from its process. If that cant be debugged I'm sorry and we will work to improve our docker install

@timothycarambat commented on GitHub (Oct 30, 2023): For what it's worth, it's because you have incorrect permissions on the database file in the host machine and docker cannot write to it from its process. If that cant be debugged I'm sorry and we will work to improve our docker install
yindo changed title from Docker composer can not build the image using official steps to [GH-ISSUE #299] Docker composer can not build the image using official steps 2026-06-05 14:33:52 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#174