thecodingmachine / docker-images-php

A set of PHP Docker images
MIT License
791 stars 140 forks source link

[v3] php7.3-dev : Depends: libssl-dev but it is not going to be installed #262

Closed robjuz closed 3 years ago

robjuz commented 3 years ago

Expected Behavior

php extensions in slim image installed

Current Behavior

php extensions not installed due to dependencies error

Possible Solution

hardcode the libssl version apt install libssl1.1=1.1.1-1ubuntu2.1~18.04.9

Steps to Reproduce (for bugs)

ARG PHP_EXTENSIONS="apcu"
FROM thecodingmachine/php:7.3-v3-slim-apache

produces

Step 1/2 : ARG PHP_EXTENSIONS="apcu"
Step 2/2 : FROM thecodingmachine/php:7.3-v3-slim-apache
# Executing 7 build triggers
 ---> Running in 90ca17c0ea05
Removing intermediate container 90ca17c0ea05
 ---> Running in ccfb59f41150
Removing intermediate container ccfb59f41150
 ---> Running in 3d88f5c647c5
+ mv /etc/apt/apt.conf.d/docker-clean /tmp/docker-clean
+ apt-get update
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 Packages [157 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [537 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [33.6 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2194 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2694 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [11.4 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [11.3 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [505 kB]
Get:18 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2258 kB]
Get:19 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1420 kB]
Get:20 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [26.7 kB]
Fetched 23.2 MB in 2s (11.6 MB/s)
Reading package lists...
+ php /usr/local/bin/install_selected_extensions.php
*** Installing extensions ***
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n apcu ']'
+ which pecl
+ apt-get install -y --no-install-recommends build-essential php-pear php7.3-dev pkg-config
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:
 php7.3-dev : Depends: libssl-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_selected_extensions.sh' returned a non-zero code: 100
robjuz commented 3 years ago

my current fix

FROM thecodingmachine/php:7.3-v3-slim-apache as base
RUN sudo apt update
RUN sudo apt install -y --allow-downgrades libssl1.1=1.1.1-1ubuntu2.1~18.04.9

ONBUILD ENV PHP_EXTENSIONS="apcu bcmath pdo_dblib pdo_mysql gd intl soap"
ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_selected_extensions.sh

FROM base
robjuz commented 3 years ago

@moufmouf Any ideas for a better fix?

robjuz commented 3 years ago

Alternative

#fix libssl-dev dependencies
FROM thecodingmachine/php:7.4-v3-slim-apache
RUN sudo apt update && sudo apt install -y --allow-downgrades libssl1.1=1.1.1-1ubuntu2.1~18.04.9

ENV PHP_EXTENSIONS="apcu bcmath pdo_dblib pdo_mysql gd intl soap" 

RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_selected_extensions.sh

COPY  composer.* ./
RUN composer install --optimize-autoloader --no-dev
COPY  . .
robjuz commented 3 years ago

@moufmouf what do you thing about pinning the libssl version in the image directly?

mistraloz commented 3 years ago

I @robjuz, to be sure : you have the same issue on V4 slim image ?

robjuz commented 3 years ago

No. Only the V3.

It’s probably related to the Ubuntu version.

V3 is using Ubuntu 18.04 an V4 20.04

mistraloz commented 3 years ago

We do not maintained this version. Please upgrade and if you need support in V4, i will help you. PR in V3 is still possible but workflow is no more activated.