title: Gitlab CI - build image and pass to next stages?
body: <p>I'm trying to setup a pipeline using Gitlab CI and PHP/Symfony project. My <code>.gitlab-ci.yml</code> file should contain 3 stages:</p>
  <ul>
  <li>Build - build the image, setup the database, install composer etc</li>
  <li>Tests
  <ul>
  <li>Unit tests</li>
  <li>Other tests (code quality, security checks)</li>
  </ul>
  </li>
  </ul>
  <p>I have it working as it should at the moment, but only by running the build steps alongside each test - this means I'm repeating the same build steps twice and it's taking longer than it should.</p>
  <p>I know that GitLab allows you to build a Docker image and store it in the project, but for the time being, is there a mechanism to build the Docker image, store it (as an artifact?), and then pass it onto the test stages so they don't need to repeat the build?</p>