espocrm / espocrm-docker

Official Docker Image for EspoCRM
https://hub.docker.com/r/espocrm/espocrm
GNU Affero General Public License v3.0
56 stars 34 forks source link

Optimize layers #42

Closed LaurentGoderre closed 2 months ago

LaurentGoderre commented 2 months ago

Collpase installation layers and image went from 550Mb to 370mb

LaurentGoderre commented 2 months ago

@whalelines the answer to both questions is that the second install step relies on the cache not being cleared in the previous step. So either we duplicate the update and clear cache or we put them in the same layer. The latter is faster to build

whalelines commented 2 months ago

But if you are combining those two RUN steps into one, why would you run the purge step at all in the middle of it?

LaurentGoderre commented 2 months ago

That purge gets rids of build dependencies for the PHP deps which is not the same as the cache.

tmachyshyn commented 2 months ago

@LaurentGoderre thanks for your contribution