title: running a phpUnit test within a docker container
body: <p>i want to run a specific version of phpUnit <strong>WITHIN</strong>  a docker container. This container will use a specific version of php. i.e </p>
  
  <p><strong>php:5.6-apache</strong></p>
  
  <p>Its a Laravel application. i have install phpunit via composer on the hostfiles and then used the volume command to transfer this to the container.<br>
  my composer.json file has following entry:</p>
  
  <blockquote>
    <p>"require-dev": {
            "phpunit/phpunit": "^5.0"
        },</p>
  </blockquote>
  
  <p>This is my docker run  command to run the test on my testdev container: </p>
  
  <pre><code>docker run --rm -it -v ~/Users/mow/Documents/devFolder/testdev:/app testdev_php "php ./vendor/bin/phpunit"
  </code></pre>
  
  <p>This returns the error: </p>
  
  <pre><code>exec: fatal: unable to exec php ./vendor/bin/phpunit: No such file or directory
  </code></pre>
  
  <p>i am unclear why it says this because te vendor directory is at the root of my site directory.</p>
  
  <p>this is my dockerfile </p>
  
  <pre><code>FROM php:5.6-apache
  
  ENV S6_OVERLAY_VERSION 1.11.0.1
  
  RUN apt-get update &amp;&amp; apt-get install -y \
      libldap2-dev \
      git \
      --no-install-recommends \
      &amp;&amp; rm -r /var/lib/apt/lists/* \
      &amp;&amp; docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
      &amp;&amp; docker-php-ext-install ldap \
      &amp;&amp; docker-php-ext-install mysqli pdo pdo_mysql
  
  #install xdebug 
  RUN git clone https://github.com/xdebug/xdebug.git \
      &amp;&amp; cd xdebug \
      &amp;&amp; git checkout tags/XDEBUG_2_5_5 \
      &amp;&amp; phpize \
      &amp;&amp; ./configure --enable-xdebug \
      &amp;&amp; make \
      &amp;&amp; make install
  
  
  RUN a2enmod rewrite
  
  COPY ./docker/rootfs /
  COPY . /app
  
  WORKDIR /app
  
  ENTRYPOINT ["/init"]
  </code></pre>
  
  <p>I guess the real question is this: what is the correct way to run a phpUnit test within a docker container so that its subject to the php version within that container.  </p>