debconf: delaying package configuration, since apt-utils is not installed - docker

I'm setting up Docker to run my CakePHP application and my Dockerfile is like
FROM php:7.2-apache
# Enable Apache Rewrite + Expires Module
RUN a2enmod rewrite expires
# Install dependencies
RUN apt-get update && apt-get install -y \
unzip \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libyaml-dev \
zlib1g-dev \
libicu-dev \
g++ \
git \
libzip-dev \
zip \
&& docker-php-ext-install opcache \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-configure zip --with-libzip \
&& docker-php-ext-install zip \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install zip
But when I run
docker-composer build
It gives me an error like
debconf: delaying package configuration, since apt-utils is not installed
The log is like
After this operation, 1607 kB of additional disk space will be used.
Get:1 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libapt-inst2.0 amd64 1.4.8 [192 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 apt-utils amd64 1.4.8 [410 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 602 kB in 1s (356 kB/s)
Selecting previously unselected package libapt-inst2.0:amd64.
(Reading database ... 13064 files and directories currently installed.)
Preparing to unpack .../libapt-inst2.0_1.4.8_amd64.deb ...
I tried methods specified in GitHub issues and suggestions.
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends apt-utils
and also
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
But none worked and still, the error is there.
Further running the process gives the following error
/usr/src/php/ext/intl/idn/idn.c: In function 'php_intl_idn_to':
/usr/src/php/ext/intl/idn/idn.c:227:4: warning: 'uidna_IDNToASCII_57' is deprecated [-Wdeprecated-declarations]
converted_ret_len = uidna_IDNToASCII(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
^~~~~~~~~~~~~~~~~
In file included from /usr/include/unicode/platform.h:23:0,
from /usr/include/unicode/ptypes.h:50,
from /usr/include/unicode/umachine.h:44,
from /usr/include/unicode/utypes.h:36,
from /usr/include/unicode/uidna.h:20,
from /usr/src/php/ext/intl/idn/idn.c:28:
/usr/include/unicode/uidna.h:673:1: note: declared here
uidna_IDNToASCII( const UChar* src, int32_t srcLength,
^
/usr/src/php/ext/intl/idn/idn.c:229:4: warning: 'uidna_IDNToUnicode_57' is deprecated [-Wdeprecated-declarations]
converted_ret_len = uidna_IDNToUnicode(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
^~~~~~~~~~~~~~~~~
In file included from /usr/include/unicode/platform.h:23:0,
from /usr/include/unicode/ptypes.h:50,
from /usr/include/unicode/umachine.h:44,
from /usr/include/unicode/utypes.h:36,
from /usr/include/unicode/uidna.h:20,
from /usr/src/php/ext/intl/idn/idn.c:28:
/usr/include/unicode/uidna.h:720:1: note: declared here
uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
^

Using DEBIAN_FRONTEND=noninteractive apt-get -yq install {your-pkgs} instead of apt-get -yq install {your-pkgs} should resolve the problem.
Refer https://stackoverflow.com/a/56569081/12782026 for details.

Related

docker build fails when installing msodbcsql17

I have a Dockerfile that built successfully two weeks ago. I changed nothing and now get this error when I try to build:
#5 32.40 The following information may help to resolve the situation:
#5 32.40
#5 32.40 The following packages have unmet dependencies:
#5 32.63 msodbcsql17 : Depends: unixodbc (>= 2.3.1) but it is not going to be installed
#5 32.67 E: Unable to correct problems, you have held broken packages.
The relevant portion of the Dockerfile is:
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
apt-transport-https \
curl \
gnupg \
unixodbc-dev \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install --yes --no-install-recommends msodbcsql17 \
Change the line:
unixodbc-dev \
To:
unixodbc \

Adding imagemagick into my php 7.4 docker raised error

I need to add imagemagick into my php 7.4 docker, so in file Dockerfile.yml I added :
FROM php:7.4.1-apache
RUN apt-get update && \
apt-get install -y \
python \
libfreetype6-dev \
libwebp-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
nano \
mc \
git-core \
libmagickwand-dev --no-install-recommends && \
pecl install imagick && imagick && \
docker-php-ext-enable imagick && \
curl ...
RUN docker-php-ext-install \
gd pdo pdo_mysql zip gmp bcmath pcntl ldap sysvmsg exif && \
a2enmod rewrite
RUN install-php-extensions imagick
COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf
But I got error:
Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so'
Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://pecl.php.net/imagick-3.5.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
/bin/sh: 1: imagick: not found
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y python libfreetype6-dev libwebp-dev libjpeg62-turbo-dev libpng-dev libzip-dev nano mc git-core libmagickwand-dev --no-install-recommends && pecl install imagick && imagick && docker-php-ext-enable imagick && curl build-essential openssl libssl-dev libgmp-dev libldap2-dev netcat locate && git clone https://github.com/nodejs/node.git && cd node && git checkout v12.0.0 && ./configure && make && make install' returned a non-zero code: 127
What is wrong in my Dockerfile.yml and how can it be fixed ?
UPDATED # 2:
I modified Dockerfile.yml :
FROM php:7.4.1-apache
RUN apt-get update && \
# apt-get install -y \
apt-get install --assume-yes --no-install-recommends --quiet \
python \
libfreetype6-dev \
libwebp-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
nano \
mc \
git-core \
libmagickwand-dev \
curl \
build-essential \
openssl \
libssl-dev \
libgmp-dev \
libldap2-dev \
netcat \
locate \
# composer \
&& git clone https://github.com/nodejs/node.git && \
cd node \
&& git checkout v12.0.0 \
&& ./configure \
&& make \
&& make install
RUN pecl install imagick \
&& docker-php-ext-enable imagick
RUN npm install cross-env
RUN npm install -g yarn
# RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
# READ https://github.com/docker-library/php/issues/912#issuecomment-559918036
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN docker-php-ext-install gd pdo pdo_mysql zip gmp bcmath pcntl ldap sysvmsg exif \
&& a2enmod rewrite
RUN apt-get install -y grep mlocate
RUN docker-php-ext-install imagick
COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf
But running :
docker-compose up -d --build
I got erros in output :
Need to get 97.7 kB of archives.
After this operation, 504 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 mlocate amd64 0.26-3 [97.7 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 97.7 kB in 0s (729 kB/s)
Selecting previously unselected package mlocate.
(Reading database ... 22379 files and directories currently installed.)
Preparing to unpack .../mlocate_0.26-3_amd64.deb ...
Unpacking mlocate (0.26-3) ...
Setting up mlocate (0.26-3) ...
update-alternatives: using /usr/bin/mlocate to provide /usr/bin/locate (locate) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/locate.1.gz because associated file /usr/share/man/man1/mlocate.1.gz (of link group locate) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man8/updatedb.8.gz because associated file /usr/share/man/man8/updatedb.mlocate.8.gz (of link group locate) doesn't exist
Adding group `mlocate' (GID 101) ...
Done.
Removing intermediate container 40f86f34f2af
---> edaee648df84
Step 10/11 : RUN docker-php-ext-install imagick
---> Running in a72d0887a6b0
error: /usr/src/php/ext/imagick does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'web' failed to build: The command '/bin/sh -c docker-php-ext-install imagick' returned a non-zero code: 1
How can I fix it ?
Thanks in advance!
The message
You should add "extension=imagick.so" to php.ini
is just a warning that is addressed later in your Dockerfile. The real error is caused by the execution of the non existing binary imagick.
You can simplify your Dockerfile as follows:
FROM php:7.4.1-apache
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends --quiet \
build-essential \
libmagickwand-dev \
&& apt-get clean all
RUN pecl install imagick \
&& docker-php-ext-enable imagick
This should fix the issue.
Output:
STEP 1/3: FROM php:7.4.1-apache
STEP 2/3: RUN apt-get update && apt-get install --assume-yes --no-install-recommends --quiet libmagickwand-dev && apt-get clean all
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [307 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7906 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [15.2 kB]
Fetched 8467 kB in 4s (2170 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
automake autotools-dev fontconfig fontconfig-config fonts-dejavu-core
gir1.2-freedesktop gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-rsvg-2.0
icu-devtools imagemagick-6-common libblkid-dev libbz2-dev libcairo-gobject2
libcairo-script-interpreter2 libcairo2 libcairo2-dev libcroco3 libdatrie1
libde265-0 libdjvulibre-dev libdjvulibre-text libdjvulibre21 libelf1
libexif-dev libexif12 libexpat1-dev libffi-dev libfftw3-double3
libfontconfig1 libfontconfig1-dev libfreetype6 libfreetype6-dev libfribidi0
libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common
libgdk-pixbuf2.0-dev libgirepository-1.0-1 libglib2.0-0 libglib2.0-bin
libglib2.0-data libglib2.0-dev libglib2.0-dev-bin libgraphite2-3
libharfbuzz0b libheif1 libice-dev libice6 libicu-dev libicu63 libilmbase-dev
libilmbase23 libjbig-dev libjbig0 libjpeg-dev libjpeg62-turbo
libjpeg62-turbo-dev liblcms2-2 liblcms2-dev liblqr-1-0 liblqr-1-0-dev
libltdl-dev libltdl7 liblzma-dev liblzo2-2 libmagickcore-6-arch-config
libmagickcore-6-headers libmagickcore-6.q16-6 libmagickcore-6.q16-6-extra
libmagickcore-6.q16-dev libmagickwand-6-headers libmagickwand-6.q16-6
libmagickwand-6.q16-dev libmount-dev libmpdec2 libnuma1 libopenexr-dev
libopenexr23 libopenjp2-7 libopenjp2-7-dev libpango-1.0-0
libpangocairo-1.0-0 libpangoft2-1.0-0 libpcre16-3 libpcre3-dev libpcre32-3
libpcrecpp0v5 libpixman-1-0 libpixman-1-dev libpng-dev libpng16-16
libpthread-stubs0-dev libpython3-stdlib libpython3.7-minimal
libpython3.7-stdlib libreadline7 librsvg2-2 librsvg2-common librsvg2-dev
libselinux1-dev libsepol1-dev libsm-dev libsm6 libthai-data libthai0
libtiff-dev libtiff5 libtiffxx5 libwebp6 libwebpmux3 libwmf-dev libwmf0.2-7
libx11-6 libx11-data libx11-dev libx265-165 libxau-dev libxau6
libxcb-render0 libxcb-render0-dev libxcb-shm0 libxcb-shm0-dev libxcb1
libxcb1-dev libxdmcp-dev libxdmcp6 libxext-dev libxext6 libxml2 libxml2-dev
libxrender-dev libxrender1 libxt-dev libxt6 python3 python3-distutils
python3-lib2to3 python3-minimal python3.7 python3.7-minimal readline-common
shared-mime-info ucf uuid-dev x11-common x11proto-core-dev x11proto-dev
x11proto-xext-dev xorg-sgml-doctools xtrans-dev zlib1g-dev
Suggested packages:
autoconf-doc gnu-standards libcairo2-doc libfftw3-bin libfftw3-dev
freetype2-doc libglib2.0-doc libxml2-utils libice-doc icu-doc liblcms2-utils
libtool-doc liblzma-doc inkscape librsvg2-bin librsvg2-doc libsm-doc
libwmf-doc libwmf0.2-7-gtk libx11-doc libxcb-doc libxext-doc libxt-doc
python3-doc python3-tk python3-venv python3.7-venv python3.7-doc
binfmt-support readline-doc
Recommended packages:
bzip2-doc libexif-doc xdg-user-dirs libtool ghostscript gsfonts libjxr-tools
libpng-tools
The following NEW packages will be installed:
automake autotools-dev fontconfig fontconfig-config fonts-dejavu-core
gir1.2-freedesktop gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-rsvg-2.0
icu-devtools imagemagick-6-common libblkid-dev libbz2-dev libcairo-gobject2
libcairo-script-interpreter2 libcairo2 libcairo2-dev libcroco3 libdatrie1
libde265-0 libdjvulibre-dev libdjvulibre-text libdjvulibre21 libelf1
libexif-dev libexif12 libexpat1-dev libffi-dev libfftw3-double3
libfontconfig1 libfontconfig1-dev libfreetype6 libfreetype6-dev libfribidi0
libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common
libgdk-pixbuf2.0-dev libgirepository-1.0-1 libglib2.0-bin libglib2.0-data
libglib2.0-dev libglib2.0-dev-bin libgraphite2-3 libharfbuzz0b libheif1
libice-dev libice6 libicu-dev libilmbase-dev libilmbase23 libjbig-dev
libjbig0 libjpeg-dev libjpeg62-turbo libjpeg62-turbo-dev liblcms2-2
liblcms2-dev liblqr-1-0 liblqr-1-0-dev libltdl-dev libltdl7 liblzma-dev
liblzo2-2 libmagickcore-6-arch-config libmagickcore-6-headers
libmagickcore-6.q16-6 libmagickcore-6.q16-6-extra libmagickcore-6.q16-dev
libmagickwand-6-headers libmagickwand-6.q16-6 libmagickwand-6.q16-dev
libmagickwand-dev libmount-dev libmpdec2 libnuma1 libopenexr-dev
libopenexr23 libopenjp2-7 libopenjp2-7-dev libpango-1.0-0
libpangocairo-1.0-0 libpangoft2-1.0-0 libpcre16-3 libpcre3-dev libpcre32-3
libpcrecpp0v5 libpixman-1-0 libpixman-1-dev libpng-dev libpng16-16
libpthread-stubs0-dev libpython3-stdlib libpython3.7-minimal
libpython3.7-stdlib libreadline7 librsvg2-2 librsvg2-common librsvg2-dev
libselinux1-dev libsepol1-dev libsm-dev libsm6 libthai-data libthai0
libtiff-dev libtiff5 libtiffxx5 libwebp6 libwebpmux3 libwmf-dev libwmf0.2-7
libx11-6 libx11-data libx11-dev libx265-165 libxau-dev libxau6
libxcb-render0 libxcb-render0-dev libxcb-shm0 libxcb-shm0-dev libxcb1
libxcb1-dev libxdmcp-dev libxdmcp6 libxext-dev libxext6 libxml2-dev
libxrender-dev libxrender1 libxt-dev libxt6 python3 python3-distutils
python3-lib2to3 python3-minimal python3.7 python3.7-minimal readline-common
shared-mime-info ucf uuid-dev x11-common x11proto-core-dev x11proto-dev
x11proto-xext-dev xorg-sgml-doctools xtrans-dev zlib1g-dev
The following packages will be upgraded:
libglib2.0-0 libicu63 libxml2
3 upgraded, 150 newly installed, 0 to remove and 46 not upgraded.
Need to get 73.0 MB of archives.
After this operation, 234 MB of additional disk space will be used.
[...]
--> 69135d97974
STEP 3/3: RUN pecl install imagick && docker-php-ext-enable imagick
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imagick-3.5.1.tgz ...
Starting to download imagick-3.5.1.tgz (301,411 bytes)
.............................................................done: 301,411 bytes
33 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Please provide the prefix of ImageMagick installation [autodetect] :
Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in PEAR/Builder.php on line 405
Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /usr/local/lib/php/PEAR/Builder.php on line 405
building in /tmp/pear/temp/pear-build-defaultuserIJdbl7/imagick-3.5.1
running: /tmp/pear/temp/imagick/configure --with-php-config=/usr/local/bin/php-config --with-imagick
[...]
checking if ImageMagick version is at least 6.2.4... found version 6.9.10
checking for MagickWand.h or magick-wand.h header... /usr/include/ImageMagick-6/wand/MagickWand.h
checking PHP version is at least 5.3.2... yes. found 7.4.1
libs
-lMagickWand-6.Q16 -lMagickCore-6.Q16
checking for MagickGetVersion... yes
[...]
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1" install
Installing shared extensions: /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/lib/php/extensions/no-debug-non-zts-20190902/
Installing header files: /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/include/php/
running: find "/tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1" | xargs ls -dils
7097429 8 drwxr-xr-x. 3 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1
7097485 8 drwxr-xr-x. 3 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr
7097487 8 drwxr-xr-x. 4 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local
7097498 8 drwxr-xr-x. 3 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/include
7097501 8 drwxr-xr-x. 3 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/include/php
7097503 8 drwxr-xr-x. 3 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/include/php/ext
7097505 8 drwxr-xr-x. 2 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/include/php/ext/imagick
7097507 4 -rw-r--r--. 1 root root 1828 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/include/php/ext/imagick/php_imagick_shared.h
7097489 8 drwxr-xr-x. 3 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/lib
7097491 8 drwxr-xr-x. 3 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/lib/php
7097493 8 drwxr-xr-x. 3 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/lib/php/extensions
7097495 8 drwxr-xr-x. 2 root root 4096 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/lib/php/extensions/no-debug-non-zts-20190902
7097483 1608 -rwxr-xr-x. 1 root root 1646360 Oct 11 07:24 /tmp/pear/temp/pear-build-defaultuserIJdbl7/install-imagick-3.5.1/usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so
Build process completed successfully
Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h'
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so'
install ok: channel://pecl.php.net/imagick-3.5.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
--> 3ee934f2bbd
3ee934f2bbdc1639a02325939d9fc1eefeb16c5803edc33424c18ecc616f7fb1

Not able to build docker image due to nginx installation error

I am not able to run the following command in the dockerfile.
RUN apt-get update && \
apt-get -y install curl && \
curl http://nginx.org/keys/nginx_signing.key | apt-key add - && \
apt-get update && \
apt-get -y install build-essential libpq-dev nginx supervisor && \
rm -rf /var/lib/apt/lists/*
I get an error like this...
Err:5 http://nginx.org/packages/debian jessie InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
Reading package lists...
W: GPG error: http://nginx.org/packages/debian jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
E: The repository 'http://nginx.org/packages/debian jessie InRelease' is not signed.
The command '/bin/sh -c apt-get update && apt-get -y install curl && curl http://nginx.org/keys/nginx_signing.key | apt-key add - && apt-get update && apt-get -y install build-essential libpq-dev nginx supervisor && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
I need to build the docker image in order to run the compose file that I found here...
https://github.com/yoanisgil/easygeoip
use this instead
FROM python:2.7-slim
RUN apt-get update && \
apt-get -y install wget gnupg && \
wget https://nginx.org/keys/nginx_signing.key && \
cat nginx_signing.key | apt-key add - && \
apt-get update && \
apt-get -y install build-essential libpq-dev nginx supervisor && \
rm -rf /var/lib/apt/lists/*
I think your curl did not produced the correct file

Build Docker compose Issue

While composing the code in docker i am getting this error, Below is the error description.
I had tried with changing some RUN commands in docekrfile.But error is not fixed.
Below is my Complete DockerFile Code:
FROM php:7.2-apache
RUN apt-get -y update --fix-missing
RUN apt-get upgrade -y
# Install useful tools
RUN apt-get -y install apt-utils nano wget dialog
# Install important libraries
RUN apt-get -y install --fix-missing apt-utils build-essential git curl libcurl3 libcurl3-dev zip openssl
# Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install xdebug
RUN pecl install xdebug-2.6.0
RUN docker-php-ext-enable xdebug
# Install redis
RUN pecl install redis-4.0.1
RUN docker-php-ext-enable redis
# Other PHP7 Extensions
RUN apt-get -y install libsqlite3-dev libsqlite3-0 mysql-client
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install pdo_sqlite
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install curl
RUN docker-php-ext-install tokenizer
RUN docker-php-ext-install json
RUN apt-get -y install zlib1g-dev
RUN docker-php-ext-install zip
RUN apt-get -y install libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install gettext
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install -j$(nproc) gd
# Enable apache modules
RUN a2enmod rewrite headers
E: Package 'libcurl3' has no installation candidate ERROR: The
command '/bin/sh -c apt-get -y install --fix-missing apt-utils
build-essential git curl libcurl3 libcurl3-dev zip openssl' returned a
non-zero code: 100

Freetype-config not found error when we install gd in php7.2-apache in Docker

I am trying to install the image php:7.2-apache from a Dockerfile,
but I have problem in gd configuration.
I have installed the latest version of docker toolbox 18.09.3 from the page https://github.com/docker/toolbox/releases/tag/v18.09.3 because I have Windows Home 10
The content of the Dockerfile is the following
FROM php:7.2-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
I have this error configure: error: freetype-config not found. during the construction of the image
checking for the location of libwebp... no
checking for the location of libjpeg... /usr/include/
checking for the location of libpng... no
checking for the location of libz... no
checking for the location of libXpm... no
checking for FreeType 2... /usr/include/
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.
Service 'apache_php' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd' returned a non-zero code: 1
Any solution ?
Referring to the reply from https://github.com/docker-library/php/issues/865#issuecomment-511163936
firstly you have to patch and fix the php bug (https://bugs.php.net/bug.php?id=76324)
RUN apt-get update && apt-get install -y pkg-config patch
ADD https://git.archlinux.org/svntogit/packages.git/plain/trunk/freetype.patch?h=packages/php /tmp/freetype.patch
RUN docker-php-source extract; \
cd /usr/src/php; \
patch -p1 -i /tmp/freetype.patch; \
rm /tmp/freetype.patch
then using the following cmd :
RUN docker-php-ext-configure gd --with-freetype-dir --with-jpeg-dir=/usr/include/
I have verified it's working for php7.2-fpm
This issue is extensively clarified in the related GitHub issue, see in particular this comment.
In brief, the whole issue is related to a change in the default Debian version. Rather than applying patches or taking more complex routes, all that is needed is to add reference to stretch in the FROM line at the beginning of the Dockerfile. In this case, the first line should read:
FROM: php:7.2-apache-stretch
All else should work as expected.
this is work for me :
FROM php:7.2-fpm
RUN apt-get update && apt-get install -y \
libicu-dev \
&& docker-php-ext-install \
intl \
opcache \
&& docker-php-ext-enable \
intl \
opcache \
&& docker-php-ext-install pdo pdo_mysql \
&& docker-php-ext-install mysqli
RUN apt-get install -y zip unzip zlib1g-dev libpng-dev
RUN docker-php-ext-install gd

Resources