Issue
To solve upgrade symfony issue, I create a new symfony project.
When create new symfony project (5.4.9), there is the question :
The recipe for this package contains some Docker configuration.
This may create/update docker-compose.yml or update Dockerfile (if it exists).
Do you want to include Docker configuration from recipes?
and I answered yes and it create a docker-compose.yml and docker-compose.override.yml
Then I forgot this and copy my docker-compose.yml file in project.
When I want to up my containers, it returns :
ERROR: The Compose file is invalid because: Service database has neither an image nor a build
context specified. At least one must be provided
under Ubuntu 22.04 (Jammy) with docker-compose v1.29.2
Solution
by running docker-compose in verbose mode :
docker-compose --verbose up -d db
where db is my first container (my database project, not the database define in symfony docker-compose), I could show it mentioned docker-compose.override.yml file that I rename for test.
It solves the error and my containers run now.
see also : https://symfony.com/doc/current/setup/docker.html
Answered By - bcag2 Answer Checked By - Clifford M. (WPSolving Volunteer)