ludwigprager / docker-seeddms

Recipe to build an SeedDMS image for Docker
7 stars 14 forks source link

Fails to build #1

Open cosmocracy opened 6 years ago

cosmocracy commented 6 years ago

I'm unable to build an image from this Dockerfile. Here is an excerpt including the error I get:

...
Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20151012/
Installing header files:          /usr/local/include/php/
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la       modules/* libs/*
 ---> 838a9ff62363
Removing intermediate container f1d6733b74dc
Step 6/13 : RUN apt-get install -q -y php-pear  php5-gd php5-sqlite poppler-utils catdoc
 ---> Running in 0fcb0dae0e18
Reading package lists...
Building dependency tree...
Reading state information...
Package php5-sqlite is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-gd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php-pear is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php-pear' has no installation candidate
E: Package 'php5-gd' has no installation candidate
E: Package 'php5-sqlite' has no installation candidate
The command '/bin/sh -c apt-get install -q -y php-pear  php5-gd php5-sqlite poppler-utils catdoc' returned a non-zero code: 100

I'll investigate further but perhaps the packages mentioned are either already included with PHP7 in this distro or have different names?

cosmocracy commented 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.

cosmocracy commented 6 years ago

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:

cosmocracy commented 6 years ago

Ok, didn't fully make the pathing changes needed for 5.1.4 but working on that now and will post working Dockerfile shortly :-)

cosmocracy commented 6 years ago

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.

Dockerfile

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