我在docker / w共享代码卷上运行本地环境。
当我的Dockerfile
运行php artisan optimize
时,它会失败...
Step 14/15 : RUN composer install && composer update
---> Running in 94698cafb7bf
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 0 installs, 2 updates, 0 removals
- Updating aws/aws-sdk-php (3.30.0 => 3.30.2): Downloading (100%)
- Updating barryvdh/laravel-ide-helper (v2.3.2 => v2.4.0): Downloading (100%)
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Illuminate\Foundation\Console\TestMakeCommand' not found
Script php artisan optimize handling the post-install-cmd event returned with error code 1
但是,我在本地运行php artisan optimize
它运行正常,而且如果我从composer.json
删除它会很好,我可以在容器上运行它而没有任何问题,我不会&#39了解为什么在构建容器时它不会运行的差异?