Open cosmocracy opened 6 years ago
From inside the base container (PHP7/Apache) it looks like sqlite3
is already a compiled module so perhaps that part of the apt-get
in the Dockerfile
can be dropped:
docker run -it --rm php:7.0-apache /bin/bash
root@73731ee009fe:/var/www/html# php -m
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
Similarly the image already seems to have pear:
root@73731ee009fe:/var/www/html# pear version
PEAR Version: 1.10.5
PHP Version: 7.0.26
Zend Engine Version: 3.0.0
Running on: Linux 73731ee009fe 4.4.0-89-generic #112-Ubuntu SMP Mon Jul 31 19:38:41 UTC 2017 x86_64
And tinkering with an intermediate container leads me to think GD gets built into PHP7 (or already is) in the base image so that dependency can go, too.
Here is my current Dockerfile
which builds fine (yet to test it though). Note that I upgraded the version of SeedDMS.
FROM php:7.0-apache
MAINTAINER Ludwig Prager <ludwig.prager@celp.de>
RUN apt-get update
RUN apt-get install -q -y libpng12-dev imagemagick
RUN docker-php-ext-install gd
RUN apt-get install -q -y poppler-utils catdoc
ADD misc/seeddms-quickstart-5.1.4.tar.gz /var/www/
RUN a2enmod rewrite
COPY misc/php.ini /usr/local/etc/php/
COPY misc/000-default.conf /etc/apache2/sites-available/
COPY misc/settings.xml /var/www/seeddms50x/seeddms-5.0.5/conf/settings.xml
RUN chown -R www-data:www-data /var/www/seeddms50x/
RUN touch /var/www/seeddms50x/seeddms-5.0.5/conf/ENABLE_INSTALL_TOOL
Note the elimination of the following apt-get install
packages which apparently are part of the latest base image:
php-pear
php5-gd
php5-sqlite
Ok, didn't fully make the pathing changes needed for 5.1.4
but working on that now and will post working Dockerfile
shortly :-)
Ok, working fine now. Note that I revised the various PHP/HTTP config files to use the newer 5.x release so that involved straightforward adjustments to the path (and the embedded tar/gzip). I also needed ActiveDirectory/LDAP so those dependencies are included in this build.
FROM php:7.0-apache
MAINTAINER Ludwig Prager <ludwig.prager@celp.de>
RUN apt-get update
RUN apt-get install -q -y libpng12-dev imagemagick
RUN docker-php-ext-install gd
RUN apt-get install -q -y poppler-utils catdoc
# Install needed php extensions: ldap
RUN \
# apt-get update && \
apt-get install libldap2-dev -y && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
docker-php-ext-install ldap
ADD misc/seeddms-quickstart-5.1.4.tar.gz /var/www/
RUN a2enmod rewrite
COPY misc/php.ini /usr/local/etc/php/
COPY misc/000-default.conf /etc/apache2/sites-available/
COPY misc/settings.xml /var/www/seeddms51x/seeddms-5.1.4/conf/settings.xml
RUN chown -R www-data:www-data /var/www/seeddms51x/
RUN touch /var/www/seeddms51x/seeddms-5.1.4/conf/ENABLE_INSTALL_TOOL
I'm unable to build an image from this
Dockerfile
. Here is an excerpt including the error I get:I'll investigate further but perhaps the packages mentioned are either already included with PHP7 in this distro or have different names?