laravel-cli icon indicating copy to clipboard operation
laravel-cli copied to clipboard

`lvl composer run` doesn't work

Open DanJFletcher opened this issue 6 years ago • 1 comments

When trying to run custom composer scripts with lvl composer run <script_name>:

/docker-entrypoint.sh: exec: line 62: run: not found

DanJFletcher avatar Oct 29 '19 20:10 DanJFletcher

As cool as having composer run in it's own container is the more I use this tool the more I think it needs to live in the app container.

Maybe it should be a separate issue, but another problem with lvl composer happens when your local install (or lack thereof) doesn't have the required language extensions for packages in your composer.json. You can get around this with lvl composer install --ignore-platform-reqs but then the workflow just feels odd.

The feedback loop is nicer when you can just run composer install and see the errors go away as you install the required extensions as opposed to flipping back and forth between using the --ignore-platform-reqs flag and not. If you don't pass the flag you will always see the same list of errors, but if you do you see no errors.

Another problem that comes out of this is when you rely on extensions that won't be installed on the composer container, this can prevent post-install tasks such as package auto-loading to break. One example is the error: Undefined class constant 'MYSQL_ATTR_SSL_CA' in the database.php file. Without the pdo_mysql extension installed you'll get that error when trying to use PDO::MYSQL_ATTR_SSL_CA.

And this segways into another topic which is maybe a broader issue. For now, I use lvl as a great starting point for my docker setup, but I always end up having to tweak the file quite a bit. Installing different versions PHP, installing different extensions, which often have dependencies on other tools like libpng-dev or libjpeg-dev to name a couple, and then which one and how I get them depends on which version of php I'm using, since that determines my parent image.

Which all makes me want to explore the possibility of having the app.dockerfile itself be configurable :D

DanJFletcher avatar Jun 18 '20 14:06 DanJFletcher