I'm upgrading an app from Symfony 5.4 (PHP 7.4) to Symfony 6.0 (PHP 8) with the help of this guide: https://symfonycasts.com/screencast/symfony6-upgrade/framework-bundle-recipe
I managed to get the 5.4 app to run properly on my Dockerfile's FROM php:8.1.0-fpm config.
However, after entering docker-compose's PHP container with docker exec -it php-container bash and running composer recipes:update symfony/framework-bundle, I encounter this error:
@:/var/www/app# composer recipes:update symfony/framework-bundle
  Updating recipe for symfony/framework-bundle...
There was an error applying the recipe update patch
Command "git rev-parse --show-prefix" failed: "fatal: not a git repository (or any parent up to mount point /var/www)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
". Output: "".
Update the recipe by re-installing the latest version with:
  composer recipes:install symfony/framework-bundle --force -v
I tried the suggested fix (re-installing) but that just overwrites my files with the exact same content. And re-running composer recipes:update afterwards still results in the same error.
How can I fix this?
Note that my .git/ directory does exist outside of the container because the Symfony app is a subdirectory of it:
├──project
│  ├──.git
│  ├──app
│  │  ├──public
│  │  ├──src
│  │  └──...
Note 2, the command composer recipes symfony/framework-bundle works fine except for the message "Error downloading exact git sha for installed recipe.":
@:/var/www/app# composer recipes symfony/framework-bundle
Error downloading exact git sha for installed recipe.
name             : symfony/framework-bundle
version          : 5.3
status           : update available
installed recipe : https://github.com/symfony/recipes/tree/master/symfony/framework-bundle/5.3
latest recipe    : https://github.com/symfony/recipes/tree/main/symfony/framework-bundle/5.4
recipe history   : https://github.com/symfony/recipes/commits/master/symfony/framework-bundle
