I don't understand how to install gd2 library with Docker on linux mint. This is my docker-compose file
version: '3'
services:
web:
build: ./web
environment:
- APACHE_RUN_USER=#1000
volumes:
- ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
- ./web/php.ini:/usr/local/etc/php/php.ini
ports:
- 8080:80
working_dir: ${APP_PATH_CONTAINER}
db:
image: mariadb
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_USER: root
MYSQL_ROOT_PASSWORD: 12345
MYSQL_DATABASE: books
MYSQL_USER: root
MYSQL_PASSWORD: 12345
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- ${DB_PATH_HOST}:/var/lib/mysql
adminer:
image: adminer
restart: always
ports:
- 6080:8080
composer:
image: composer:1.6
volumes:
- ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
working_dir: ${APP_PATH_CONTAINER}
command: composer install
After I do docker-compose up --build
and I have no errors during the building, but when I do docker exec -it books_web_1 bash
and check php version php -v
, I get this error
PHP Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/gd2 (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/gd2: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/gd2.so (/usr/local/lib/php/extensions/no-debug-non-zts-20190902/gd2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Dockerfile for 'web' container
FROM php:7.4-apache
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
libmcrypt-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libpq-dev \
zlib1g-dev \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install \
pdo \
pdo_mysql \
pgsql \
bcmath \
gd \
&& a2enmod \
rewrite
RUN rm -rf /var/lib/apt/lists/*
So what else do i need for install gd2?