Docker Unable to locate package RUN - docker

I have docker image that run perfectly with no issues on another server using same docker image and everything exactly the same.
now i try to copy the same image to new server and when i try to install it, i face this error
I'm trying to run docker php image and i get this error below
0.0s
=> ERROR [ 2/14] RUN apt-get update && apt-get install -y --no-install-recommends autoconf build-essential apt-utils zlib1g-dev libzip-dev unzip zip libmagick++-dev libmagickwand-dev libpq-dev libfreetype6-dev l 4.4s
------
> [ 2/14] RUN apt-get update && apt-get install -y --no-install-recommends autoconf build-essential apt-utils zlib1g-dev libzip-dev unzip zip libmagick++-dev libmagickwand-dev libpq-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev RUN docker-php-ext-install gd intl pdo_mysql pdo_pgsql mysqli zip:
#0 0.377 Get:1 http://security.debian.org/debian-security bullseye-security InRelease [48.4 kB]
#0 0.377 Get:2 http://deb.debian.org/debian bullseye InRelease [116 kB]
#0 0.387 Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
#0 0.493 Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [222 kB]
#0 0.619 Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
#0 0.757 Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [14.6 kB]
#0 1.937 Fetched 8628 kB in 2s (5482 kB/s)
#0 1.937 Reading package lists...
#0 2.676 Reading package lists...
#0 3.481 Building dependency tree...
#0 3.690 Reading state information...
#0 3.900 E: Unable to locate package RUN
#0 3.900 E: Unable to locate package docker-php-ext-install
#0 3.900 E: Unable to locate package gd
#0 3.900 E: Unable to locate package intl
#0 3.900 E: Unable to locate package pdo_mysql
#0 3.900 E: Unable to locate package pdo_pgsql
#0 3.900 E: Unable to locate package mysqli
------
failed to solve: process "/bin/sh -c apt-get update && apt-get install -y --no-install-recommends autoconf build-essential apt-utils zlib1g-dev libzip-dev unzip zip libmagick++-dev libmagickwand-dev libpq-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev RUN docker-php-ext-install gd intl pdo_mysql pdo_pgsql mysqli zip" did not complete successfully: exit code: 100
Dockerfile
FROM php:7.4.29-apache
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
build-essential \
apt-utils \
zlib1g-dev \
libzip-dev \
unzip \
zip \
libmagick++-dev \
libmagickwand-dev \
libpq-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
sendmail
RUN docker-php-ext-install gd intl pdo_mysql pdo_pgsql mysqli zip
RUN pecl install imagick-3.4.3
RUN pecl install xdebug && docker-php-ext-enable xdebug
RUN docker-php-ext-enable imagick
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN echo "sendmail_path=/usr/sbin/sendmail -t -i" >> /usr/local/etc/php/conf.d/sendmail.ini
RUN sed -i '/#!\/bin\/sh/aservice sendmail restart' /usr/local/bin/docker-php-entrypoint
# Clear package lists
RUN apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Permissions
RUN chown -R root:www-data /var/www/html
RUN chmod u+rwx,g+rx,o+rx /var/www/html
RUN find /var/www/html -type d -exec chmod u+rwx,g+rx,o+rx {} +
RUN find /var/www/html -type f -exec chmod u+rw,g+rw,o+r {} +
WORKDIR /var/www/html
RUN a2enmod rewrite
RUN a2enmod ssl
EXPOSE 80
EXPOSE 443
docker-compose.yml file
version: '3.8'
services:
WebApp:
container_name: "apache-server"
build:
context: .docker/php
dockerfile: Dockerfile
image: server-apache
volumes:
- .docker/apache/server.pem:/etc/ssl/certs/server.pem
- .docker/apache/server-key.pem:/etc/ssl/private/server-key.pem
- .docker/apache/000-default.conf:/etc/apache2/sites-enabled/000-default.conf
- ./src:/var/www/html
ports:
- 80:80
- 443:443
restart: always
database:
container_name: database
image: mysql
volumes:
- .docker/db:/var/lib/mysql
ports:
- "9906:3306"
environment:
MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD
MYSQL_DATABASE: MYSQL_DATABASE
MYSQL_USER: MYSQL_USER
MYSQL_PASSWORD: MYSQL_PASSWORD
restart: always
phpmyadmin:
container_name: PhpMyAdmin
image: phpmyadmin/phpmyadmin
ports:
- '8080:80'
restart: always
environment:
PMA_HOST: database
UPLOAD_LIMIT: 128M
depends_on:
- database
volumes:
databaseData:
external: false
i tried change php version to the latest still getting same error
i tried looking up the error online, i didn't find such error
------UPDATE-------
The docker version on the old server is 20.10.7
The new server docker version is: 23.0.0

Related

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

Laravel Sail Failed to Build

I'm struggling to get Laravel Sail working. Following the instructions from the documentation I'm not really understanding why the container is failing to build. I don't have any docker experience.
./vendor/bin/sail php -v
returns "Cannot load Xdebug - it was already loaded"
./vendor/bin/sail build --no-cache fails who what reason?
Sorry if not much to go on, anyone who could point me in the right direction would be much appreciated.
wazimshizm#Surface-Pro-6:~/code/sports$ ./vendor/bin/sail php -v
Cannot load Xdebug - it was already loaded
PHP 8.0.7 (cli) (built: Jun 4 2021 21:26:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies
with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
wazimshizm#Surface-Pro-6:~/code/sports$ ./vendor/bin/sail build --no-cache
mysql uses an image, skipping
redis uses an image, skipping
meilisearch uses an image, skipping
mailhog uses an image, skipping
selenium uses an image, skipping
Building laravel.test
[+] Building 64.7s (8/16)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 2.42kB 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 906B 0.0s
=> [ 1/12] FROM docker.io/library/ubuntu:20.04 0.0s
=> CACHED [ 2/12] WORKDIR /var/www/html 0.0s
=> [ 3/12] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone 0.5s
=> ERROR [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unz 64.0s
------
> [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*:
#7 1.140 Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
#7 1.546 Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
#7 3.365 Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
#7 4.008 Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
#7 4.747 Get:5 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
#7 4.889 Get:6 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
#7 5.676 Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
#7 11.34 Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
#7 63.42 Reading package lists...
#7 63.94 E: Release file for http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease is not valid yet (invalid for another 5h 15min 5s). Updates for this repository will not be applied.
#7 63.94 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 5h 15min 24s). Updates for this repository will not be applied.
#7 63.94 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease is not valid yet (invalid for another 5h 15min 54s). Updates for this repository will not be applied.
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
ERROR: Service 'laravel.test' failed to build : Build failed
wazimshizm#Surface-Pro-6:~/code/sports$ ./vendor/bin/sail build --no-cache
mysql uses an image, skipping
redis uses an image, skipping
meilisearch uses an image, skipping
mailhog uses an image, skipping
selenium uses an image, skipping
Building laravel.test
[+] Building 64.5s (8/16)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 38B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 0.0s
=> [ 1/12] FROM docker.io/library/ubuntu:20.04 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 99B 0.0s
=> CACHED [ 2/12] WORKDIR /var/www/html 0.0s
=> [ 3/12] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone 0.5s
=> ERROR [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unz 63.8s
------
> [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*:
#7 1.142 Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
#7 1.219 Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
#7 3.044 Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
#7 3.684 Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
#7 4.414 Get:5 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
#7 56.13 Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
#7 61.75 Get:7 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
#7 62.16 Get:8 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
#7 63.17 Reading package lists...
#7 63.76 E: Release file for http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease is not valid yet (invalid for another 5h 12min 49s). Updates for this repository will not be applied.
#7 63.76 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 5h 13min 7s). Updates for this repository will not be applied.
#7 63.76 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease is not valid yet (invalid for another 5h 13min 38s). Updates for this repository will not be applied.
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
ERROR: Service 'laravel.test' failed to build : Build failed
build:
context: ./vendor/laravel/sail/runtimes/8.0
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.0/app
Change 8.1 to ...runtimes/8.0 and and sail-8.0 , then try sail up

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

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.

Install php7.0-sybase inside docker php:7.0-apache-stretch

On my container (FROM php:7.0-apache-stretch)
apt update
apt install php7.0-sybase
Result :
E: Package 'php7.0-sybase' has no installation candidate
File /etc/apt/sources.list :
deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
How to install this package?
Thanks
Below that worked with me on php:5.6-apache to connect to Sybase:
I use provided script docker-php-ext-configure and docker-php-ext-install in Official PHP image to install sybase_ct extensions.
And use FreeTDS to connect to Sybase server.
Here is my Dockerfile:
FROM php:5.6-apache
RUN apt-get update && apt-get install -y unixodbc unixodbc-dev freetds-dev freetds-bin tdsodbc \
&& docker-php-ext-configure sybase_ct --with-sybase-ct=/usr \
&& docker-php-ext-install sybase_ct
COPY ./src/ /var/www/html/
COPY ./odbcinst.ini /etc/
COPY ./freetds.conf /home/
RUN cat /home/freetds.conf >> /etc/freetds/freetds.conf
Configured odbcinst.ini file to copy to /etc/odbcinst.ini
[FreeTDS]
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
Configured freetds.conf file to add in /etc/freetds/freetds.conf
# Sybase Server
[ServerName]
host = example.com
port = 5000
tds version = 5.0

Issue with using Dockerfile to build image

I have trouble with using dockerfile to build image.
dockerfile:
FROM node:4.4
MAINTAINER paas
ENV NGINX_VERSION 1.11.6-1~jessie
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
&& echo "deb nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
nginx=${NGINX_VERSION} \
nginx-module-xslt \
nginx-module-geoip \
nginx-module-image-filter \
nginx-module-perl \
nginx-module-njs \
gettext-base \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /etc/nginx/sites-enabled
# SSL Certificate Installation
ADD star_dar_kz.key /etc/ssl/
# ADD star_dar_kz.pem /etc/ssl/
# ADD dhparam.pem /etc/ssl/
# ADD nginx.conf /etc/nginx/
# ADD merchants.dar.kz.conf /etc/nginx/sites-enabled
COPY . /app
WORKDIR /app
RUN npm install --global gulp-cli
RUN npm install --global bower
RUN npm install
RUN bower --allow-root install
RUN gulp build --env prod
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
And after docker build, the GPG line appears as red and image creation fails. Why?
Sending build context to Docker daemon 3.072kB
Step 1/16 : FROM node:4.4
---> 93b396996a16
Step 2/16 : MAINTAINER Nurbek Sadykov
---> Using cache
---> e9a0bc967863
Step 3/16 : ENV NGINX_VERSION 1.11.6-1~jessie
---> Using cache
---> 3e87467bd365
Step 4/16 : RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 && echo "deb h:/nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list && apt-get update && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates nginx=${NGINX_VERSION} nginx-module-xslt nginx-module-geoip nginx-module-image-filter nginx-module-perl nginx-module-njs gettext-base curl && rm -rf /var/lib/apt/lists/*
---> Running in 93f88784bc24
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.acoVZ86x3m --no-auto-check-trustdb --trust-model always --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
**gpg: requesting key 7BD9BF62 from hkp server pgp.mit.edu**
**gpg: key 7BD9BF62: public key "nginx signing key " imported**
**gpg: Total number processed: 1**
**gpg: imported: 1 (RSA: 1)** - ** THIS IS INDICATED IN RED COLOR**
Get:1 url InRelease [63.1 kB]
Get:2 url InRelease [2865 B]
Ign url jessie InRelease
Get:3 url jessie-updates InRelease [145 kB]
Get:4 url amd64 Packages [37.3 kB]
Get:5 url jessie Release.gpg [2373 B]
Get:6 urljessie Release [148 kB]
Get:7 url amd64 Packages [613 kB]
Get:8 url amd64 Packages [23.2 kB]
Get:9 url jessie/main amd64 Packages [9063 kB]
Fetched 10.1 MB in 5s (1835 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
**Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming**.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nginx-module-geoip : Depends: nginx (= 1.13.7-1~jessie)
nginx-module-image-filter : Depends: nginx (= 1.13.7-1~jessie)
nginx-module-njs : Depends: nginx (= 1.13.7-1~jessie)
nginx-module-perl : Depends: nginx (= 1.13.7-1~jessie)
nginx-module-xslt : Depends: nginx (= 1.13.7-1~jessie)
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 && echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list && apt-get update && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates nginx=${NGINX_VERSION} nginx-module-xslt nginx-module-geoip nginx-module-image-filter nginx-module-perl nginx-module-njs gettext-base curl && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
There were three issues in your Dockerfile:
Incorrect url to nginx packages
Nginx modules should be the same version as nginx
There is no version 1.11.6-1~jessie for module nginx-module-njs, so we need to add one more ENV variable.
The final Dockerfile is:
FROM node:4.4
MAINTAINER paas
ENV NGINX_VERSION 1.11.6-1~jessie
ENV NGINX_MODULE_NJS 1.11.6.0.1.4-2~jessie
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
&& echo 'deb http://nginx.org/packages/mainline/debian/ jessie nginx' >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
nginx=${NGINX_VERSION} \
nginx-module-xslt=${NGINX_VERSION} \
nginx-module-geoip=${NGINX_VERSION} \
nginx-module-image-filter=${NGINX_VERSION} \
nginx-module-perl=${NGINX_VERSION} \
nginx-module-njs=${NGINX_MODULE_NJS} \
gettext-base \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /etc/nginx/sites-enabled
# SSL Certificate Installation
ADD star_dar_kz.key /etc/ssl/
# ADD star_dar_kz.pem /etc/ssl/
# ADD dhparam.pem /etc/ssl/
# ADD nginx.conf /etc/nginx/
# ADD merchants.dar.kz.conf /etc/nginx/sites-enabled
COPY . /app
WORKDIR /app
RUN npm install --global gulp-cli
RUN npm install --global bower
RUN npm install
RUN bower --allow-root install
RUN gulp build --env prod
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Resources