Need PHP ldap extension on Docker Image with Apache2, PHP 5.6 and Oracle built on Debian Jessie

168 Views Asked by At

I have an PHP application that uses ldap functions, when I run it in Docker I get an error: "Fatal error: Call to undefined function ldap_connect()". Docker image used for building the app is: https://github.com/thomasbisignani/docker-apache-php-oracle. Is there a way to enable ldap extension without changing the Docker image used and what do I need to write extra in my Docker file to make it work. Right now my Docker file is simple only contains 4 lines:

FROM thomasbisignani/docker-apache-php-oracle
COPY  . /myapp
WORKDIR /var/www/html
CMD ["php","./index.php"]

Tryed adding this lines to Docker file:

RUN apk update \
    && apk add --no-cache --virtual .build-dependencies-in-virtual-world openldap-dev \
    && docker-php-ext-install ldap \
    && docker-php-ext-enable  ldap \
    && apk del .build-dependencies-in-virtual-world
RUN apt-get update && \
    apt-get install -y ldap-utils libldap2-dev && \
    rm -rf /var/lib/apt/lists/*

and many more...

but I always get an error when building the app docker build -t my-php-app .:

ERROR [2/5] RUN apt-get update && apt-get install -y ldap-utils ...
0

There are 0 best solutions below