Docker - jpeglib.h not found

Viewed 183

I'm trying to start a docker container with docker-compose up -d, but i get the error configure: error: jpeglib.h not found

This is what the dockerfile looks like:

FROM php:7.2.18-apache

[..]

RUN apt-get update -qq && apt-get install -y -qq \
        libicu-dev \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng-dev \
        libcurl4-openssl-dev \
        libzip-dev \
        software-properties-common  \
        libcurl3 curl \
        git \
        zip \
        unzip \
        inotify-tools \
        build-essential \
        libxml2-dev libxslt1-dev zlib1g-dev \
        git \
        mysql-client \
        sshpass \
        gnupg \
        nano \
        sudo \
        vim \
        graphviz \
        netcat-openbsd \
        ant \

 [...]

RUN docker-php-ext-install iconv mbstring opcache
RUN docker-php-ext-configure gd --with-freestyle-dir=/usr/include/  --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install gd

I already tried several things like using --with-freestyle --with-jpeg instead of --with-freestyle-dir=/usr/include/ --with-jpeg-dir=/usr/include/ resulting in configure: error: png.h not found. I also tried it with docker-php-ext-install -j$(nproc) which didn't work either.

Does someone have an idea what could be done about it?

Thanks

1 Answers

I'd suggest you to try to use swap the images

Old: "FROM php:7.2.18-apache"

New: "FROM php:7.4-apache"

If you still want to use mysql, you need to change the mysql part to "default-mysql-client" And delete the "libcurl3 curl" part, you can't use libcurl3 and libcurl4 simultaneously

Related