title: Installing GD extension in Docker
body: <p>I'm new to Docker and I'm trying to install PHP <strong>GD</strong> extension.</p>
  
  <p>This is my current Dockerfile:</p>
  
  <pre><code>FROM php:7.4-fpm-alpine
  
  RUN docker-php-ext-install mysqli pdo pdo_mysql bcmath gd
  </code></pre>
  
  <p>When running the docker via <code>docker-compose build &amp;&amp; docker-compose up -d</code> I'm getting a lots of errors and in the end I get this message:</p>
  
  <pre><code>configure: error: Package requirements (zlib) were not met:
  
  Package 'zlib', required by 'virtual:world', not found
  
  Consider adjusting the PKG_CONFIG_PATH environment variable if you
  installed software in a non-standard prefix.
  
  Alternatively, you may set the environment variables ZLIB_CFLAGS
  and ZLIB_LIBS to avoid the need to call pkg-config.
  See the pkg-config man page for more details.
  ERROR: Service 'php' failed to build: The command '/bin/sh -c docker-php-ext-install mysqli pdo pdo_mysql bcmath gd' returned a non-zero code: 1
  </code></pre>
  
  <p>Without the "gd" at the end the Docker container runs normally.</p>
  
  <p>What could be the problem and how could I fix it?</p>