title: Composer in php-fpm docker from composer:1.8.4
body: <p>I have a .dockerfile that builds a php-fpm image and I try to install composer from a docker image like so:</p>
  <pre><code>FROM php:7.3.3-fpm-alpine as base
  
  WORKDIR /var/www
  
  # Override Docker configuration: listen on Unix socket instead of TCP
  RUN sed -i &quot;s|listen = 9000|listen = /var/run/php/fpm.sock\nlisten.mode = 0666|&quot; /usr/local/etc/php-fpm.d/zz-docker.conf
  
  # Install dependencies
  RUN set -xe \
      &amp;&amp; apk add --no-cache bash icu-dev \
      &amp;&amp; docker-php-ext-install pdo pdo_mysql intl pcntl
  
  CMD [&quot;php-fpm&quot;]
  
  FROM composer:1.8.4 as composer
  
  RUN rm -rf /var/www &amp;&amp; mkdir /var/www
  WORKDIR /var/www
  
  COPY composer.* /var/www/
  
  ARG APP_ENV=dev
  
  RUN set -xe \
      &amp;&amp; if [ &quot;$APP_ENV&quot; = &quot;prod&quot; ]; then export ARGS=&quot;--no-dev&quot;; fi \
      &amp;&amp; composer install --prefer-dist --no-scripts --no-progress --no-suggesthere
  </code></pre>
  <p>The problem is that the COPY composer.* /var/www/ does not seem to work properly because it throws the error:</p>
  <ul>
  <li>composer install --prefer-dist --no-scripts --no-progress --no-suggest --no-interaction --no-dev
  Composer could not find a composer.json file in /var/www</li>
  </ul>
  <p>It seems like either the composer image is missing something or I skip some step, could you please assist, I am both new to docker and php.</p>