docker-images icon indicating copy to clipboard operation
docker-images copied to clipboard

Docker Build Modular Dependency problem

Open Vdapiton1516 opened this issue 2 years ago • 16 comments

I'm trying to build my docker with oracle database.

been using the FROM ghcr.io/oracle/oraclelinux8-php:7.4-fpm-20221104

now I'm getting an error of Modular Dependency Problem when running RUN dnf module enable -y php:7.4 php-oci8 `

Error: Problems in request:
Modular dependency problems:

 Problem: module php-oci8:21c:8060020221011134100:34611983.x86_64 requires module(php:8.0), but none of the providers can be installed
  - module php:7.4:8030020200615123046:a4870ff1.x86_64 conflicts with module(php:8.0) provided by php:8.0:8060020211215065547:0a326c83.x86_64
  - module php:8.0:8060020211215065547:0a326c83.x86_64 conflicts with module(php:7.4) provided by php:7.4:8030020200615123046:a4870ff1.x86_64
  - module php:7.4:8030020200615123046:a4870ff1.x86_64 conflicts with module(php:8.0) provided by php:8.0:8060020220622070726:5caa48ff.x86_64
  - module php:8.0:8060020220622070726:5caa48ff.x86_64 conflicts with module(php:7.4) provided by php:7.4:8030020200615123046:a4870ff1.x86_64
  - module php:7.4:8030020200615123046:a4870ff1.x86_64 conflicts with module(php:8.0) provided by php:8.0:8070020220801083134:afd00e68.x86_64
  - module php:8.0:8070020220801083134:afd00e68.x86_64 conflicts with module(php:7.4) provided by php:7.4:8030020200615123046:a4870ff1.x86_64
  - conflicting requests

`

already tried using the newer image FROM ghcr.io/oracle/oraclelinux8-php:7.4-fpm-20221214 but no luck. hope some can help me

Vdapiton1516 avatar Dec 15 '22 06:12 Vdapiton1516

You need to use PHP 8.0 with php-oci8:21c which is something I've been meaning to add, but haven't found the time yet.

@cjbj what's the right version of php-oci8 to use with older versions of PHP?

Djelibeybi avatar Dec 15 '22 06:12 Djelibeybi

image

https://yum.oracle.com/oracle-linux-php.html#UpdatingPHP

as per oracle. 7.4 is compatible with php-oci8

Vdapiton1516 avatar Dec 15 '22 06:12 Vdapiton1516

DNF disagrees with that documentation, as per module php-oci8:21c:8060020221011134100:34611983.x86_64 requires module(php:8.0). It might be a bug that the latest php-oci8 module now depends on php:8.0, which is something @cjbj is the right person to follow-up on.

Djelibeybi avatar Dec 15 '22 06:12 Djelibeybi

Something is broken somewhere because it doesn't work even when I provide the specific version and context for the module stream that requires PHP 7.4. If you have Oracle Support, I encourage you to open an SR as that would get the fastest response.

Djelibeybi avatar Dec 15 '22 06:12 Djelibeybi

php-oci8:21c

I tried using php 8 but now it says it requires 7.4 . image

tho this happened to me last month, all I did was change my docker image. FROM ghcr.io/oracle/oraclelinux8-php:7.4-fpm change to FROM ghcr.io/oracle/oraclelinux8-php:7.4-fpm-20221104 and it fixed the issue. But now 20221104 doesn't work and I tried using the latest image still no lucj

Vdapiton1516 avatar Dec 15 '22 07:12 Vdapiton1516

Something is broken somewhere because it doesn't work even when I provide the specific version and context for the module stream that requires PHP 7.4. If you have Oracle Support, I encourage you to open an SR as that would get the fastest response.

sadly i dont have an Oracle Support.

Vdapiton1516 avatar Dec 15 '22 07:12 Vdapiton1516

facing the same problem here using FROM ghcr.io/oracle/oraclelinux:8

no solution found yet. image

pedrodiascastro avatar Dec 15 '22 13:12 pedrodiascastro

This is affecting our builds now too, so I'm going to raise it internally.

Djelibeybi avatar Dec 16 '22 03:12 Djelibeybi

This is affecting our builds now too, so I'm going to raise it internally.

thank you . hope they fix it asap.

Vdapiton1516 avatar Dec 16 '22 04:12 Vdapiton1516

is it possible that the issue might be the oraclelinux-developer-release-el8 or the oracle-instantclient-release-el8

it is possible to set a later version when installing it?

Vdapiton1516 avatar Dec 19 '22 07:12 Vdapiton1516

It's an issue with the php-oci8 RPM itself. The build team are working on it. You could probably install an older version, though.

Djelibeybi avatar Dec 19 '22 13:12 Djelibeybi

It's an issue with the php-oci8 RPM itself. The build team are working on it. You could probably install an older version, though.

any idea how can i use an older version ? sorry not really familiar with this things yet.

this is currently my docker file

# Copyright (c) 2021 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
FROM ghcr.io/oracle/oraclelinux8-php:7.4-fpm


RUN dnf install -y epel-release
# RUN yum update -y 
RUN yum install -y supervisor
RUN yum clean all && rm -rf /var/cache/yum

RUN dnf -y module enable nginx && dnf -y install nginx && rm -rf /var/cache/dnf && ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
RUN dnf install -y oraclelinux-developer-release-el8 oracle-instantclient-release-el8 libpng-devel libzip-devel

RUN dnf module enable -y php:7.4 php-oci8
RUN dnf install -y php php-oci8-21c
RUN dnf install -y php-fpm php-pdo php-pdo_mysql php-zip php-gd php-json php-openssl php-curl php-tokenizer php-dom php-opcache php-pear
RUN dnf install -y git unzip

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN sed -i "s/listen = 0.0.0.0:9000/listen = 0.0.0.0:9004/g" /etc/php-fpm.d/www.conf

ADD ./dockerfiles/nginx/default.conf /etc/nginx/conf.d/

RUN mkdir -p /var/www/html
WORKDIR /var/www/html

ARG UID
ARG GID

ENV UID=${UID}
ENV GID=${GID}

RUN groupadd -g ${GID} --system laravel
RUN adduser -g laravel --system -s /bin/sh -u ${UID} laravel

RUN sed -i "s/user = apache/user = laravel/g" /etc/php-fpm.d/www.conf
RUN sed -i "s/group = apache/group = laravel/g" /etc/php-fpm.d/www.conf

COPY --chown=laravel:laravel . /var/www/html

EXPOSE 8084
EXPOSE 8086

ADD ./dockerfiles/supervisord.ini /etc/supervisord.d/supervisord.ini

CMD ["supervisord","-n"]`
```

Vdapiton1516 avatar Dec 19 '22 13:12 Vdapiton1516

It's an issue with the php-oci8 RPM itself. The build team are working on it. You could probably install an older version, though.

is there any documentation on how to install specific version?

Vdapiton1516 avatar Dec 19 '22 14:12 Vdapiton1516

Any Update on this?

Vdapiton1516 avatar Dec 22 '22 17:12 Vdapiton1516

@Vdapiton1516 what did you end up doing? The issue is still present in oraclelinux:8.7

LoganConnor44 avatar Mar 23 '23 21:03 LoganConnor44

@Vdapiton1516 what did you end up doing? The issue is still present in oraclelinux:8.7

what I did was instead of running install oraclelinux, i downloaded the SDK and unzipping it inside the docker

COPY ./docker/oracle/instantclient-basic.zip /opt/oci
COPY ./docker/oracle/instantclient-sdk.zip /opt/oci
COPY ./docker/oracle/pdo_oci.zip /opt/oci
COPY ./docker/oracle/oci8.zip /opt/oci
RUN cd /opt/oci \
    && unzip instantclient-basic.zip \
    && unzip instantclient-sdk.zip \
    && cd instantclient_12_1/ \
    && ln -s /opt/oci/instantclient_12_1/libclntsh.so.12.1 libclntsh.so \
    && ln -s /opt/oci/instantclient_12_1/libocci.so.12.1 libocci.so \
    && ls \ 
    && cd ../ \
    && unzip pdo_oci.zip \
    && cd pdo_oci \
    && phpize \
    && ./configure --with-pdo-oci=shared,instantclient,/opt/oci/instantclient_12_1 \
    && make \
    && make install \
    && echo "extension=pdo_oci.so" >> /etc/php7/conf.d/pdo_oci.ini \
    && cd /opt/oci \
    && unzip oci8.zip \
    && cd oci8 \
    && phpize \
    && ./configure --with-oci8=shared,instantclient,/opt/oci/instantclient_12_1 \
    && make \
    && make install \
    && echo "extension=oci8.so" >> /etc/php7/conf.d/oci8.ini \
    && cd /opt/oci \
    && rm *.zip

hope this helps in your end.

Vdapiton1516 avatar Sep 11 '23 09:09 Vdapiton1516