title: How to mount a volume to your Docker Image on a Gitlab Runner? (gitlab-ci.yml)
body: <p>I've running a Docker image for browser testing setup on my gitlab runner. This is specified in a gitlab-ci.yml like so:</p>
  
  <pre><code>test:
    stage: test
    services:
      - name: mysql:5.7
        alias: mysql-test
    image: chilio/laravel-dusk-ci:stable
    script:
      - cp .env.ci .env
        ...
  </code></pre>
  
  <p>Now, when I run multiple tests, the first ones succeed and the rest fails. It seems this might be related to the shared memory, according to this issue: <a href="https://github.com/elgalu/docker-selenium/issues/20" rel="nofollow noreferrer">elgalu/docker-selenium#20</a>. I've already increased the shm_size setting on the gitlab runner itself, however I think I need to mount the docker image's shm folder to the runner's shm folder. Normally I would specify this in a docker-compose.yml or on the commandline like so:</p>
  
  <pre><code>docker run -v /dev/shm:/dev/shm
  </code></pre>
  
  <p>However I can't figure out how to do this in the <code>gitlab-ci.yml</code>. On the <code>image</code> key you can only specify a <code>name</code> and <code>entrypoint</code>... <a href="https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#available-settings-for-image" rel="nofollow noreferrer">as documented here</a></p>
  
  <p><strong>The question is:</strong> Can anyone tell me how mount the folder?</p>
  
  <p>ps: for those interested, this is the error:</p>
  
  <pre><code>Facebook\WebDriver\Exception\NoSuchDriverException: invalid session id
  </code></pre>