I am building a Docker image and the Dockerfile
looks like follow:
FROM ubuntu:12.04
MAINTAINER Maintainer Name <my_address@goes.here>
VOLUME ["/var/www"]
RUN apt-get update && \
apt-get install -y \
apache2 \
php5 \
php5-cli \
libapache2-mod-php5 \
php5-gd \
php5-ldap \
php5-mysql
COPY apache_default /etc/apache2/sites-available/default
COPY run /usr/local/bin/run
RUN chmod +x /usr/local/bin/run
RUN a2enmod rewrite
EXPOSE 80
CMD ["/usr/local/bin/run"]
The run file contains the following code:
#!/bin/bash
set -e
PHP_ERROR_REPORTING=${PHP_ERROR_REPORTING:-"E_ALL & ~E_DEPRECATED & ~E_NOTICE"}
sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php5/apache2/php.ini
sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php5/cli/php.ini
sed -ri "s/^error_reporting\s*=.*$//g" /etc/php5/apache2/php.ini
sed -ri "s/^error_reporting\s*=.*$//g" /etc/php5/cli/php.ini
echo "error_reporting = $PHP_ERROR_REPORTING" >> /etc/php5/apache2/php.ini
echo "error_reporting = $PHP_ERROR_REPORTING" >> /etc/php5/cli/php.ini
source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND
I am seeing some errors output to the console when I run the command:
docker build -t dev-image .
The lines marked with ---
(this is just for show you the lines doesn’t mean that the ouput has such symbol) at the end are marked in red in the console:
...
Get:69 http://archive.ubuntu.com/ubuntu/ precise-updates/main ssl-cert all 1.0.28ubuntu0.1 [12.3 kB]
debconf: delaying package configuration, since apt-utils is not installed ---
Fetched 26.7 MB in 48s (550 kB/s)
...
Unpacking ucf (from .../ucf_3.0025+nmu2ubuntu1_all.deb) ...
Moving old data out of the way ---
Selecting previously unselected package ttf-dejavu-core
...
Setting up ucf (3.0025+nmu2ubuntu1) ...
debconf: unable to initialize frontend: Dialog ---
debconf: (TERM is not set, so the dialog frontend is not usable.) ---
debconf: falling back to frontend: Readline ---
debconf: unable to initialize frontend: Readline ---
debconf: (This frontend requires a controlling tty.) ---
debconf: falling back to frontend: Teletype ---
Setting up ttf-dejavu-core (2.33-2ubuntu1) ...
...
Setting up php5-cli (5.3.10-1ubuntu3.24) ...
debconf: unable to initialize frontend: Dialog ---
debconf: (TERM is not set, so the dialog frontend is not usable.) ---
debconf: falling back to frontend: Readline ---
debconf: unable to initialize frontend: Readline ---
debconf: (This frontend requires a controlling tty.) ---
debconf: falling back to frontend: Teletype ---
Creating config file /etc/php5/cli/php.ini with new version ---
update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode.
...
Setting up apache2-mpm-prefork (2.2.22-1ubuntu1.11) ...
invoke-rc.d: policy-rc.d denied execution of start. ---
Setting up apache2 (2.2.22-1ubuntu1.11) ...
...
ldconfig deferred processing now taking place
Errors were encountered while processing:
ssl-cert
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update && apt-get install -y apache2 php5 php5-cli libapache2-mod-php5 php5-gd php5-ldap php5-mysql' returned a non-zero code: 100
Why? What I am not notice here? Did I miss something?
I am running Docker 1.10.3 in Fedora 24:
$ docker -v
Docker version 1.10.3, build a612434/1.10.3