suityou01
(Suityou01)
July 21, 2019, 5:17pm
1
configure: error: jpeglib.h not found
sometmes its png.h not found
driving me absolutely crazy. I have followed every stackoverflow article I have been able to find on google to no avail.
can someone please take a look?
here is my compose file
version: ‘3’
services:
php-apache:
image: php:7.2.1-apache
ports:
- 80:80
volumes:
- ./DocumentRoot:/var/www/html:z
links:
- ‘mariadb’
command: docker-php-ext-install mysqli pdo pdo_mysql
command: apt-get update --fix-missing && apt-get install -y
curl
build-essential
libssl-dev
libfreetype6-dev
nano
libxpm-dev
libjpeg62-turbo-dev
libpng-dev
libmcrypt-dev
libicu-dev
libxml2-dev
libwebp-dev
command: docker-php-ext-install -j$(nproc) iconv
command: docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
mariadb:
image: mariadb:10.1
ports:
- 3306:3306
volumes:
- mariadb:/var/lib/mysql
environment:
TZ: “Europe/Rome”
MYSQL_ALLOW_EMPTY_PASSWORD: “no”
MYSQL_ROOT_PASSWORD: “blah”
MYSQL_USER: ‘testuser’
MYSQL_PASSWORD: ‘blah’
MYSQL_DATABASE: ‘testdb’
volumes:
mariadb:
terpz
(Martin Terp)
July 21, 2019, 6:08pm
2
Hi
You cant have multiple commands, atleast not like this.
The best thing you can do is to build and image where this is installed (will also speed up deployment time)
according to: https://hub.docker.com/_/php
PHP Core Extensions
For example, if you want to have a PHP-FPM image with iconv
and gd
extensions, you can inherit the base image that you like, and write your own Dockerfile
like this:
FROM php:7.2-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
2 Likes
suityou01
(Suityou01)
July 22, 2019, 9:21am
3
Works like a charm. I feel my understanding of docker base images has improved so do feel a little sheepish for the original post, so thank you for your patient and informative response.
1 Like
sexy22
(Sexy22)
March 9, 2020, 5:56am
4
This helps me a lot and very appreciated.