title: how to install php-amqplib in alpine image?
body: <p>I use docker-compose version: '3' and need to install <code>php-amqplib</code>. I faced with strange behaviour. Thrown exception about missing <code>sockets</code>, but I installed and added to my composer.json, how to install <code>php-amqplib</code> ?</p>
  <pre><code>FROM php:7.4-fpm-alpine
  
  LABEL maintainer=&quot;Vincent Composieux &lt;vincent.composieux@gmail.com&gt;&quot;
  
  RUN apk add --update --no-cache \
      coreutils \
      yarn \
      php7-fpm \
      php7-apcu \
      php7-ctype \
      php7-curl \
      php7-dom \
      php7-gd \
      php7-iconv \
      php7-imagick \
      php7-json \
      php7-intl \
      php7-mcrypt \
      php7-fileinfo\
      php7-mbstring \
      php7-opcache \
      php7-openssl \
      php7-pdo \
      php7-pdo_mysql \
      php7-mysqli \
      php7-pdo_pgsql \
      php7-pgsql \
      php7-xml \
      php7-zlib \
      php7-phar \
      php7-tokenizer \
      php7-session \
      php7-simplexml \
      php7-xdebug \
      php7-zip \
      php7-xmlwriter \
      make \
      curl \
      zlib-dev \
      libxml2-dev \
      rabbitmq-c-dev \
      oniguruma-dev \
      php7-pecl-amqp \
      php7-amqp \
      php7-redis
  
  
  # Extensions
  RUN echo &quot;Extensions install - start&quot; \
      # Sockets
      &amp;&amp; docker-php-ext-install sockets \
      # Amqp
      &amp;&amp; apk add --no-cache --update rabbitmq-c-dev \
      &amp;&amp; apk add --no-cache --update --virtual .phpize-deps $PHPIZE_DEPS \
      &amp;&amp; pecl install -o -f amqp \
      &amp;&amp; docker-php-ext-enable amqp \
      &amp;&amp; apk del .phpize-deps \
      #
      &amp;&amp; echo &quot;Extensions install - finish&quot;
  
  RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ php7-pecl-mongodb
  
  RUN echo &quot;$(curl -sS https://composer.github.io/installer.sig) -&quot; &gt; composer-setup.php.sig \
          &amp;&amp; curl -sS https://getcomposer.org/installer | tee composer-setup.php | sha384sum -c composer-setup.php.sig \
          &amp;&amp; php composer-setup.php &amp;&amp; rm composer-setup.php* \
          &amp;&amp; chmod +x composer.phar &amp;&amp; mv composer.phar /usr/bin/composer
  
  COPY symfony.ini /etc/php7/conf.d/
  COPY symfony.ini /etc/php7/cli/conf.d/
  COPY xdebug.ini  /etc/php7/conf.d/
  
  COPY symfony.pool.conf /etc/php7/php-fpm.d/
  
  CMD [&quot;php-fpm7&quot;, &quot;-F&quot;]
  
  WORKDIR /var/www/symfony
  EXPOSE 9001
  
  
  composer require php-amqplib/php-amqplib
  
  
  Your requirements could not be resolved to an installable set of packages.
  
    Problem 1
      - The requested PHP extension ext-sockets * is missing from your system. Install or enable PHP's sockets extension.
    Problem 2
      - php-amqplib/php-amqplib v2.12.0 requires ext-sockets * -&gt; the requested PHP extension sockets is missing from your system.
      - php-amqplib/php-amqplib 2.12.x-dev requires ext-sockets * -&gt; the requested PHP extension sockets is missing from your system.
      - Installation request for php-amqplib/php-amqplib ^2.12@dev -&gt; satisfiable by php-amqplib/php-amqplib[2.12.x-dev, v2.12.0].
  </code></pre>
  <p>part of composer.json</p>
  <pre><code>&quot;require&quot;: {
      &quot;php&quot;: &quot;^7.2.5&quot;,
      &quot;ext-amqp&quot;: &quot;*&quot;,
      &quot;ext-ctype&quot;: &quot;*&quot;,
      &quot;ext-iconv&quot;: &quot;*&quot;,
      &quot;ext-json&quot;: &quot;*&quot;,
      &quot;ext-mongodb&quot;: &quot;*&quot;,
      &quot;ext-openssl&quot;: &quot;*&quot;,
      &quot;ext-pdo&quot;: &quot;*&quot;,
      &quot;ext-redis&quot;: &quot;*&quot;,
      &quot;ext-sockets&quot;: &quot;*&quot;,
      &quot;ext-zip&quot;: &quot;*&quot;,
  </code></pre>