fhsinchy / guide-to-containerizing-laravel-applications

Project codes used in "A Practical Guide to Containerizing Laravel Applications With Docker"
https://adevait.com/laravel/containerizing-laravel-applications-with-docker
38 stars 43 forks source link

Configure extenstion packages before installation in base image #3

Open bromi0 opened 1 year ago

bromi0 commented 1 year ago

I've tried to base image on your setup and found out that GD doesn't get configured in the way you propose:

# compile native PHP packages
RUN docker-php-ext-install \
    gd \
    pcntl \
    bcmath \
    mysqli \
    pdo_mysql

# configure packages
RUN docker-php-ext-configure gd --with-freetype --with-jpeg

You can easy see it in php info, no Freetype in GD section. AFAIR the docker configure script is essentially doing make configure with proper docker way, so it should go before install. I've tried to swap steps and got Freetype support in phpinfo.

bromi0 commented 1 year ago

More so, the way in your guide creates enormous layer anyway. So have to -configure && -install in one RUN.