phpunit-docker icon indicating copy to clipboard operation
phpunit-docker copied to clipboard

Remove Composer from image

Open mvhirsch opened this issue 7 years ago • 3 comments

While using composer for installing phpunit is appreciated, it shouldn't be included in the final image. Since the main point of phphunit/phpunit is a functional phpunit runable, composer should be removed.

This would result in a smaller image size.

Could this be achieved with ONBUILD somehow? I'm missing some experience in maintaining docker images, but I'm willing to help, if someone can point me in the right direction.

mvhirsch avatar Feb 05 '18 09:02 mvhirsch

I personally use this image on my CI server to:

  • grab my source
  • install dependencies via composer
  • run unit tests

westy92 avatar Feb 17 '18 20:02 westy92

Composer must be used with: https://hub.docker.com/_/composer/

JulienBreux avatar Feb 19 '18 10:02 JulienBreux

After some months of Docker I've learned something useful, which should help on this issue: multi-stage builds. https://docs.docker.com/develop/develop-images/multistage-build/

mvhirsch avatar Aug 28 '18 12:08 mvhirsch