Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

262
Vistas
docker php:7.1-fpm-alpine fails to build GD

Trying to build from the official php:7.1-fpm-alpine image, using the following excerpt in my Dockerfile:

FROM php:7.1-fpm-alpine

RUN set -ex \
    apk add --no-cache --virtual .build-deps \
    freetype-dev \
    libjpeg-turbo-dev \
    libpng-dev \
\
    && docker-php-ext-configure gd \
        --with-freetype-dir=/usr \
        --with-png-dir=/usr \
        --with-jpeg-dir=/usr \
    && docker-php-ext-install gd \
    && apk del .build-deps

When attempting to build this with docker build, GD fails during ./configure with the following error:

configure: error: jpeglib.h not found

I can confirm that jpeglib.h exists and is exactly where I think it should be (indeed, exactly where it is in Debian variants):

$ docker run -it --rm php:7.1-fpm-alpine /bin/sh
>$ apk add --no-cache libjpeg-turbo-dev \
   && find /usr -type f -name 'jpeglib.h'
   ...
   /usr/include/jpeglib.h

But if I take exactly the same command used in the dockerfile and run it interactively inside the container, it builds flawlessly. No errors.

Is this a bug, or am I missing something?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

The problem was a blindingly simple syntax error; the apk call following the set command needs to be preceded by &&, otherwise the interpreter is treating the entire apk call as a set of arguments to set. In that case, the packages aren't added, therefore jpeglib.h didn't exist.

When I typed the command into the shell, I used the correct syntax, so it passed without error.

over 4 years ago · Santiago Trujillo Denunciar

0

yes, you should write like this

RUN set -ex \
    && apk add --no-cache --virtual .build-deps \
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda