Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

`docker-compose up` gives this error in project dir.

Open hemangjoshi37a opened this issue 2 years ago • 9 comments
trafficstars

command I ran : docker-compose up Error I got :

ERROR: The Compose file is invalid because:
Service backend has neither an image nor a build context specified. At least one must be provided.

When I asked chatGPT this question it gave me following answer.

It looks like the backend service in your docker-compose.yaml file does not have an image or build specified. You must specify either an image or a build in your service configuration in order to create the service.

You can specify an image like this:

services:
  backend:
    image: my-backend-image

Or you can specify a build like this:

services:
  backend:
    build:
      context: .
      dockerfile: Dockerfile.backend

In the example above, context specifies the build context, and dockerfile specifies the path to the Dockerfile.

Make sure to include either an image or a build in the backend service configuration in your docker-compose.yaml file.

hemangjoshi37a avatar Jan 05 '23 09:01 hemangjoshi37a

'docker-compose' is the old way of doing that. Can you try 'docker compose up --build' please. Also what's the version of your docker?

kostiak avatar Jan 05 '23 10:01 kostiak

@kostiak is correct. docker-compose might work but the really important part is --build since all the images have to be built locally.

fozziethebeat avatar Jan 05 '23 10:01 fozziethebeat

I'm going to mark this I'm going to mark this as closed after verifying that the main README includes the --build flag.

fozziethebeat avatar Jan 05 '23 10:01 fozziethebeat

Also what's the version of your docker?

sudo docker version

Client: Docker Engine - Community
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:54:09 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:52:16 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b63
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

'docker compose up --build'

this command gives me this error.

unknown flag: --build
See 'docker --help'.
Usage:  docker [OPTIONS] COMMAND
A self-sufficient runtime for containers

hemangjoshi37a avatar Jan 05 '23 10:01 hemangjoshi37a

@hemangjoshi37a Looks similar to #284 Update docker and try again.

kostiak avatar Jan 05 '23 10:01 kostiak

Re-opening. Something we could do regarding documentation is specify which version of Docker is required. Would anyone like to update the main README with that qualification?

fozziethebeat avatar Jan 05 '23 10:01 fozziethebeat

Looks similar to #284 Update docker and try again.

@kostiak Thanks for the suggestion brother.

Would anyone like to update the main README with that qualification?

@fozziethebeat Once I get it solved, I will fix readme.md. Assign me for that bugfix.

hemangjoshi37a avatar Jan 05 '23 11:01 hemangjoshi37a

Thank you for helping improve the documentation.

fozziethebeat avatar Jan 05 '23 11:01 fozziethebeat

Would anyone like to update the main README with that qualification?

@fozziethebeat Please review pull request : #453

hemangjoshi37a avatar Jan 06 '23 17:01 hemangjoshi37a

Maybe we can make a FAQ.md or something like that and build up some common stuff over time. I'll try pull something together.

andrewm4894 avatar Jan 06 '23 18:01 andrewm4894

Or adding a GitHub discussion for each question (with FAQ tag) could be useful perhaps if we decide to turn on GitHub discussions

https://github.com/LAION-AI/Open-Assistant/issues/334

andrewm4894 avatar Jan 06 '23 18:01 andrewm4894

Captura de tela de 2023-01-06 16-40-09

Hi, I was also having the same problem, I ran docker with sudo docker-compose up --build and it worked

ghost avatar Jan 06 '23 19:01 ghost

@sir-braz do not run docker-compose - that's the old way of running it.

Please try to run the following:

docker compose up --build

also, make sure to run it from the project's root directory. In your case ~/Documentos/Open-Assistant/.

kostiak avatar Jan 06 '23 19:01 kostiak

This solved my issue. Closing.

   DOCKER_CONFIG=${DOCKER_CONFIG:/usr/local/lib/docker}
   mkdir -p $DOCKER_CONFIG/cli-plugins
   curl -SL https://github.com/docker/compose/releases/download/v2.15.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
   chmod +x $DOCKER_CONFIG/docker-compose
   sudo chmod +x $DOCKER_CONFIG/docker-compose
   sudo cp $DOCKER_CONFIG/docker-compose $DOCKER_CONFIG compose
   chmod +x $DOCKER_CONFIG/compose
   sudo chmod +x $DOCKER_CONFIG/compose
   sudo docker compose version

hemangjoshi37a avatar Jan 07 '23 04:01 hemangjoshi37a