Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
docker php: 7.1-fpm-alpine no puede construir GD

Intentando construir a partir de la imagen oficial php:7.1-fpm-alpine , usando el siguiente extracto en mi 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

Al intentar compilar esto con docker build , GD falla durante ./configure con el siguiente error:

 configure: error: jpeglib.h not found

Puedo confirmar que jpeglib.h existe y está exactamente donde creo que debería estar (de hecho, exactamente donde está en las variantes de Debian):

 $ 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

Pero si tomo exactamente el mismo comando que se usa en el archivo acoplable y lo ejecuto de forma interactiva dentro del contenedor, se construye sin problemas. Sin errores.

¿Es esto un error o me estoy perdiendo algo?

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

El problema era un error de sintaxis deslumbrantemente simple; la llamada apk que sigue al comando set debe ir precedida de && ; de lo contrario, el intérprete tratará la llamada apk completa como un conjunto de argumentos para set . En ese caso, los paquetes no se agregan, por lo que jpeglib.h no existe.

Cuando escribí el comando en el shell, usé la sintaxis correcta, por lo que pasó sin errores.

about 4 years ago · Santiago Trujillo Report

0

Sí, deberías escribir así.

 RUN set -ex \ && apk add --no-cache --virtual .build-deps \
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!