2017-10-18 08:26
浏览 160

Docker php:fpm-install php扩展

I am using the official php:fpm docker image as base for my application container, so the Dockerfile starts like so:

FROM php:fpm

Later in the file I would like to have something like that:

RUN apt-get install -y \

But that tells me:

E: Unable to locate package php7.0-gd
E: Couldn't find any package by regex 'php7.0-gd'

»Bashing« into the container using docker exec -it <name> /bin/bash and executing: apt-cache search php | grep gd yields:

php5-gdcm - Grassroots DICOM PHP5 bindings
php5-vtkgdcm - Grassroots DICOM VTK PHP bindings
php5-gd - GD module for php5

So since that is a debian (yessie) based image, only the old php5 packages are available and php7 is installed by some tricky script in the php:fpm dockerfile and it seams that all extensions are compiled within the used php executable.

How can I install more extensions in this scenario?

1条回答 默认 最新

相关推荐 更多相似问题