title: docker php:7.1-fpm-alpine fails to build GD
body: <p>Trying to build from the official <code>php:7.1-fpm-alpine</code> image, using the following excerpt in my Dockerfile:</p>
  
  <pre><code>FROM php:7.1-fpm-alpine
  
  RUN set -ex \
      apk add --no-cache --virtual .build-deps \
      freetype-dev \
      libjpeg-turbo-dev \
      libpng-dev \
  \
      &amp;&amp; docker-php-ext-configure gd \
          --with-freetype-dir=/usr \
          --with-png-dir=/usr \
          --with-jpeg-dir=/usr \
      &amp;&amp; docker-php-ext-install gd \
      &amp;&amp; apk del .build-deps
  </code></pre>
  
  <p>When attempting to build this with <code>docker build</code>, GD fails during <code>./configure</code> with the following error:</p>
  
  <pre><code>configure: error: jpeglib.h not found
  </code></pre>
  
  <p>I can confirm that <code>jpeglib.h</code> exists and is exactly where <em>I think it should be</em> (indeed, exactly where it is in Debian variants):</p>
  
  <pre><code>$ docker run -it --rm php:7.1-fpm-alpine /bin/sh
  &gt;$ apk add --no-cache libjpeg-turbo-dev \
     &amp;&amp; find /usr -type f -name 'jpeglib.h'
     ...
     /usr/include/jpeglib.h
  </code></pre>
  
  <p>But if I take <em>exactly</em> the same command used in the dockerfile and run it interactively inside the container, it builds flawlessly. No errors.</p>
  
  <p>Is this a bug, or am I missing something?</p>