A symfony app is created in a php Docker image (php:8.1.10-fpm).
Since a symfony update (5.4.*) the build fails when trying to install the composer packages (composer install –optimize-autoloader):
#16 3.555 Generating optimized autoload files
#16 5.572 93 packages you are using are looking for funding.
#16 5.572 Use the `composer fund` command to find out more!
#16 5.780 > symfony-cmd
#16 5.781 sh: 1: symfony-cmd: not found
#16 5.781 Script symfony-cmd handling the auto-scripts event returned with error code 127
#16 5.781 Script @auto-scripts was called via post-install-cmd
#16 5.781 Plugins have been disabled automatically as you are running as root, this may be the cause of the script failure.
#16 5.781 See also https://getcomposer.org/root
------
executor failed running [/bin/sh -c composer install --optimize-autoloader]: exit code: 127
ERROR: Service 'app' failed to build : Build failed
The symfony/flex plugin is in the “allow-plugins” region as described here: sh: symfony-cmd: command not found
I was able to solve this issue by removing the “auto-script” section in the composer.json:
"scripts": {
"auto-scripts": { <--- DELETE ME
"cache:clear": "symfony-cmd", <--- DELETE ME
"assets:install %PUBLIC_DIR%": "symfony-cmd" <--- DELETE ME
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
But I have to admin that i don’t know for what reason I need these auto-scripts. My app is running as expected. Does anyone know how to solve this issue without removing the auto-scripts and what their actual job is?