Open-Assistant
Open-Assistant copied to clipboard
ERROR: Service backend has neither an image nor a build context for docker compose on Debian-based distributions.
The docker compose up --build
command gives the following error:
ERROR: The Compose file is invalid because:Service backend has neither an image nor a build context specified. At least one must be provided.
In order to fix the issue on Debian-based distros the docker-compose-plugin needs to be installed with:
apt install docker-compose-plugin
@oickrwens I've just built it on my Ubuntu 22 without this issue poping up. Could you specify what distro are you using so I can reproduce this issue? Or simply try:
backend:
build:
context: .
dockerfile: docker/Dockerfile.backend
Hi, I was experiencing issues on Debian 11 and Ubuntu 22.04, but got it to work on both.
Basically, there is an issue with the docker compose tool. By default docker does not include compose in the Linux version: https://github.com/docker/compose/issues/8630
so the docker compose
command will give: command docker: 'compose' is not a docker command
error.
Instead what needs to be used is docker-compose
which is a separate package that needs to get installed.
However, after installing the package and running the command docker-compose up --build
there is yet another error:
ERROR: The Compose file './docker-compose.yaml' is invalid because: services.backend.depends_on contains an invalid type, it should be an array services.web.depends_on contains an invalid type, it should be an array' likely caused by the difference in the compose versions.
I found that installing the docker-compose-plugin fixes all the issues.
sudo apt update
sudo apt install docker-compose
sudo apt install docker-compose-plugin
Docker version for Ubuntu: Docker version 20.10.12, build 20.10.12-0ubuntu4 Docker version for Debian: Docker version 20.10.5+dfsg1, build 55c4c88 on Google Compute Engine
FYI: https://stackoverflow.com/a/66516826
Thank you all. I've added a reference to the project's README. Let me know in case this issue pops up again or remains.