Skip to content
Advertisement

dockerfile: `composer install –no-dev installs dev-dependencies, then deletes them straight away after

My docker-compose setup does (I think) some wierd things.

I am installing from this composer.json:

JavaScript

And my dockerfile looks like:

JavaScript

When running composer install I get:

JavaScript

Can anyone tell me why it would install and then remove the dev packages instead of just omitting them from the original install?

The container for the dockerfile is php744-apache

Advertisement

Answer

Pretty simple: you run composer update (which will update the list of packages, and install them), and afterwards you run composer install --no-dev.

Just out of curiosity: this is only done when updating the Docker image. Is there any good reason for this? Why don’t you decouple the image and the source code running in that image?

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement