-1

I try to build a Laravel app and i have an error when i try to build the docker image

My docker file:

FROM php:7.3-fpm

COPY composer.lock composer.json /var/www/

COPY database /var/www/database

WORKDIR /var/www

RUN apt-get update && apt-get -y install git && apt-get -y install zip

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
    && php -r "if (hash_file('SHA384', 'composer-setup.php') === 'c31c1e292ad7be5f49291169c0ac8f683499edddcfd4e42232982d0fd193004208a58ff6f353fde0012d35fdd72bc394') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
    && php composer-setup.php \
    && php -r "unlink('composer-setup.php');" \
    && php composer.phar install --no-dev --no-scripts \
    && rm composer.phar

COPY . /var/www

RUN chown -R www-data:www-data \
        /var/www/storage \
        /var/www/bootstrap/cache

RUN  apt-get install -y libmcrypt-dev \
        libmagickwand-dev --no-install-recommends \
        && pecl install mcrypt-1.0.2 \
        && docker-php-ext-install pdo_mysql \
        && docker-php-ext-enable mcrypt

RUN mv .env.prod .env

RUN php artisan optimize

And a screen of my error:

here

Thanks for the help

Val
  • 6,585
  • 5
  • 22
  • 52
  • You need to update the docker file to install the GD extension for the first error in that list. See https://stackoverflow.com/questions/39657058/installing-gd-in-docker for info. – Jonnix Nov 13 '20 at 09:16

1 Answers1

1

From your error details, you can see that there's few extensions missings:

  1. ext-gd
  2. ext-ldap

You have to install these extensions in your docker image the same way you did with PDO. You can achieve that with docker-php-ext-install and docker-php-ext-enable.

Theses extensions will probably require you to do some package installation before, with apt-get install XXX

aadlani
  • 601
  • 5
  • 18