title: Composer install doesn't install packages when running in Dockerfile
body: <p>I cannot seem to run composer install in Dockerfile but I can in the container after building an image and running the container.</p>
  
  <p>Here's the command from Dockerfile:</p>
  
  <pre><code>RUN composer require drupal/video_embed_field:1.5
  RUN composer install --no-autoloader --no-scripts --no-progress
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>Loading composer repositories with package information
  Installing dependencies (including require-dev) from lock file
  Nothing to install or update
  </code></pre>
  
  <p>But after running the container with docker-compose:</p>
  
  <pre><code>...
  drupal:
      image: docker_image
      container_name: container
      ports:
        - 8081:80
      volumes:
        - ./container/modules:/var/www/html/web/modules
  
      links:
        # Link the DB container:
        - db
  </code></pre>
  
  <p>running docker exec composer install will install the packages correctly:</p>
  
  <pre><code>Loading composer repositories with package information
  Installing dependencies (including require-dev) from lock file
  Package operations: 1 installs, 0 updates, 0 removals
  ...
  Generating autoload files
  </code></pre>
  
  <p>I am assuming that the composer.json and composer.lock files are correct because I can run the composer install command in the container without any further effort, but only after the container is running. </p>
  
  <p><strong>Update</strong>
  Tried combining the composer commands with:</p>
  
  <pre><code>RUN composer require drupal/video_embed_field:1.5 &amp;&amp; composer install
  </code></pre>
  
  <p>Same issue, "Nothing to install or update". Ultimately I would like to continue using seperate RUN statements in Dockerfile to take advantage of docker caching.</p>