Не удалось собрать Dockerfile — не удалось найти пакет

Я на тренировке и меня просят установить среду разработки, проблема в том, что она не работает. Но для других все хорошо

инструкции просты:

  • установить виртуальную машину на мои окна (Debian Jessie с VMware)
  • тянуть проект на вм
  • сделать сборку docker-compose

проблема в том, что когда я собираю (docker-compose build), он говорит мне:

    Building backend
Step 1/27 : FROM php:5.6-apache
---> a7188ff4c552
Step 2/27 : RUN rm /etc/apt/preferences.d/no-debian-php
---> Using cache
---> 5e10fb8a2d21
Step 3/27 : RUN apt-get update && apt-get install -y bash alien libaio1 git zlib1g-dev libxml2-dev nodejs-legacy npm libfontconfig libicu-dev g++ libpcre3-dev pdftk php5-apcu
---> Running in 04d17961b6f2
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:2 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [442 kB]
Ign:3 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Get:4 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages [12.1 kB]
Get:7 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B]
Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 Packages [9530 kB]
Fetched 10.3 MB in 2s (4115 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package npm
E: Unable to locate package php5-apcu
ERROR: Service 'backend' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y bash alien libaio1 git zlib1g-dev libxml2-dev nodejs-legacy npm libfontconfig libicu-dev g++ libpcre3-dev pdftk php5-apcu' returned a non-zero code: 100

Dockerfile:

FROM php:5.6-apache

RUN rm /etc/apt/preferences.d/no-debian-php

# Dependencies
RUN apt-get update && apt-get install -y bash alien libaio1 git zlib1g-dev libxml2-dev nodejs-legacy npm libfontconfig libicu-dev g++ libpcre3-dev pdftk php5-apcu
#RUN npm install -g phantomjs@1.9.8
RUN npm install -g phantomjs

ENV ORACLE_HOME /usr/lib/oracle/11.2/client64/
ENV C_INCLUDE_PATH /usr/include/oracle/11.2/client64/

# Installation Instant client
WORKDIR /root
COPY ./libs/oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm /root/oracle-instantclient11.2-basic.rpm
COPY ./libs/oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm  /root/oracle-instantclient11.2-devel.rpm
RUN alien -d oracle-instantclient11.2-basic.rpm \
&& alien -d oracle-instantclient11.2-devel.rpm \
&& rm -f oracle-instantclient11.2-*.rpm \
&& dpkg -i oracle-instantclient11.2-basic_*.deb \
&& dpkg -i oracle-instantclient11.2-devel_*.deb \
&& rm -f oracle-instantclient11.2-*.deb

# Install pecl oci8 extension
RUN if [ ! "$http_proxy" = "" ]; then pear config-set http_proxy $http_proxy; fi
RUN pecl channel-update pecl.php.net \
&& pecl download oci8-2.0.10 && tar xzf oci8-*.tgz && rm oci8-*.tgz && cd oci8-* \
&& phpize && ./configure && make && make install \
&& echo "extension=oci8.so" >> /usr/local/etc/php/conf.d/oci8.ini \
&& cd .. && rm -Rf oci8-*

# pour ext ldap
RUN apt-get install -y php5-ldap \
&& ln -s /etc/php5/mods-available/ldap.ini /usr/local/etc/php/conf.d/ \
&& ln -s /etc/php5/mods-available/apcu.ini /usr/local/etc/php/conf.d/ \
&& ln -s /usr/lib/php5/20131226/ldap.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ \
&& ln -s /usr/lib/php5/20131226/apcu.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226

# Install Arial Font
RUN sed -i s/main/main\ contrib/g /etc/apt/sources.list
RUN apt-get update && apt-get install -y ttf-mscorefonts-installer

# Install PHP additional dependencies
RUN docker-php-ext-install -j$(nproc) zip soap intl opcache

# Install Symfony and composer CLI
RUN curl -LsS --insecure https://symfony.com/installer -o /usr/local/bin/symfony \
&& curl -LsS --insecure https://getcomposer.org/composer.phar -o /usr/local/bin/composer
RUN chmod a+x /usr/local/bin/symfony /usr/local/bin/composer

# Enable extra Apache mods
RUN a2enmod rewrite vhost_alias headers expires

# Install custom conf
COPY ./configs/vhost.conf /etc/apache2/sites-enabled/vhost.conf
COPY ./configs/php.ini /usr/local/etc/php/php.ini
COPY ./configs/php-cli.ini /usr/local/etc/php/php-cli.ini
RUN rm -f /etc/apache2/sites-enabled/000-default.conf

# Change working directory in order to run all Symfony commands from application root directory
WORKDIR /var/www/app

COPY ./bin/run.sh /usr/local/bin/run-container
RUN chmod a+x /usr/local/bin/run-container
CMD ["run-container"]

0

Решение

При сборке докер говорит вам, что не может найти пакет npm.
Попробуйте установить эти пакеты другим способом.

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

sudo apt-get install -y nodejs

И другие пакеты

0

Другие решения

Проблема решена: это потому, что php: 5.6-apache теперь является ссылкой на php: 5.6-apache-stretch, а не php: 5.6-apache-jessie.

0

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector