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

How to add missing PHP extensions?

Open simonhamp opened this issue 1 year ago • 1 comments

I have a Composer dependency that requires imagick, but it seems it's not included here. How can I add it?

simonhamp avatar Jun 28 '24 11:06 simonhamp

Hello @simonhamp!

1️⃣ If you want to locally build an image from this repository and include an additional package in that image, you can include the package in the list of packages installed from the Dockerfile template, in this line here. As you can see this line installs packages listed in a custom file, which is selected based on the current PHP_VERSION. These files are available in the php/packages/ folder.

2️⃣ On the other hand, if you'll be extending the image built from this repository, found in dockerhub. Then you can simply add another RUN command to install the extension, likeso:

ARG PHP_VERSION=8.2
ARG NODE_VERSION=18
FROM fideloper/fly-laravel:${PHP_VERSION} as base

ARG PHP_VERSION

# Include the new package
+ RUN apt-get update; \
+    apt-get install -y imagemagick php${PHP_VERSION}-imagick;

KTanAug21 avatar Jul 03 '24 12:07 KTanAug21