G
G
goodw842021-02-08 17:57:44
PHP
goodw84, 2021-02-08 17:57:44

How to install php7.4-gd inside docker and enable it in PHP settings?

  1. I use Gitlab CI & CD, build a Docker image
  2. In docker I need Composer + NPM

Dockerfile:
FROM php:7.4.7-fpm
USER root

RUN apt -y update
RUN apt -y --no-install-recommends install unzip wget curl libaio1 openssl
RUN apt-get update && apt-get upgrade -y
RUN apt -y install lsb-release apt-transport-https ca-certificates
RUN apt install -y software-properties-common
RUN add-apt-repository ppa:ondrej/php
RUN apt update
RUN apt-get install -y php7.4-gd

WORKDIR /app
COPY ./composer.json ./
COPY . .

RUN curl -sS https://getcomposer.org/installer -o composer-setup.php \
    && php composer-setup.php --install-dir=/usr/local/bin --filename=composer

RUN composer self-update
RUN composer update
RUN composer install --no-dev && rm ./composer-setup.php


Problem:
Unable to locate package php7.4-gd

Question: how to install php7.4-gd inside docker and enable it in PHP settings?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2021-02-08
@goodw84


RUN apt-get install -y php7.4-gd
do instead

RUN apt-get install -y libpng-dev  &&  docker-php-ext-install gd

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question