Имеется джоба в Jenkins, которая запускает контейнер, и выполняет сборку PHP-приложения на Yii.
Во время сборки PHP-приложения – билд падает с ошибкой:
…
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:
php7.3-curl : Depends: libcurl3 (>= 7.44.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
The command ‘/bin/sh -c apt -y update && apt -y install php7.3 curl php7.3-amqp
…
Проверяем Dockerfile
, из которого собирался образ, используемый для билда:
FROM debian RUN apt update && apt -y install ca-certificates apt-transport-https wget gnupg git RUN wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add - RUN echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php.list RUN apt -y update && apt -y install php7.3 curl php7.3-amqp
Обращаем внимание на исходный образ:
FROM debian
И строку:
RUN echo “deb https://packages.sury.org/php/ stretch main”
Dockerfile
старый, который мы использовали изначально, но использует Debian без указания версии, следовательно – использует последний доступный образ, с тегом latest, который содержит последнюю актуальную версию Debian.
Проверяем имя системы:
[simterm]
root@jenkins-production:/home/admin# docker run -ti debian cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)"
[/simterm]
buster, тогда как репозиторий добавляется для packages.sury.org/php/ stretch main.
Меняем в Dockerfile
stretch на buster, пересобираем его:
[simterm]
root@jenkins-production:/home/admin# docker build -t projectname/projectname-backend-builder:1.5 . ... Step 9/9 : COPY auth.json /root/.composer/auth.json ---> c032b53c381b Successfully built c032b53c381b Successfully tagged projectname/projectname-backend-builder:1.5
[/simterm]
Готово.