mlocati / docker-php-extension-installer

Easily install PHP extensions in Docker containers
MIT License
4.26k stars 384 forks source link

`redis` from source cannot be installed (download/clone submodules) #901

Closed mvorisek closed 7 months ago

mvorisek commented 7 months ago

Version of install-php-extensions

latest + php-src master

issue is present on both Alpine and Debian

Error description

...
#10 166.1 ### INSTALLING REMOTE MODULE redis ###
#10 166.3   (installing version 6.0.2 from /tmp/src/tmp.ko5iVVBxCv/phpredis-8a39caebe89)
#10 166.4 ERROR: file /tmp/src/tmp.ko5iVVBxCv/phpredis-8a39caebe89/liblzf/LICENSE does not exist

Docker image

ghcr.io/mvorisek/image-php:8.4-debian-base

Minimal Dockerfile

install-php-extensions phpredis/phpredis@8a39caebe89
mvorisek commented 7 months ago

liblzf is a submodule, is it correctly recursively checkout before install?

mlocati commented 7 months ago

install-php-extensions doesn't use git to download repositories (git is rather big). What I'd do in your script/process:

  1. install git
  2. clone redis and its submodules
  3. run install-php-extensions passing it the folder containing the local redis clone
  4. delete the local redis clone
  5. uninstall git
mvorisek commented 7 months ago

Thank you.

In theory https://github.com/mlocati/docker-php-extension-installer/blob/2.2.5/install-php-extensions#L285 could use git when present, but let's not complicate things, submodules are rare.