title: Docker & gitlab-ci: Build application in Dockerfile but also create artifact
body: <p>I have a Dockerfile which builds my web application and then moves the built application to an nginx folder such that I only have to start the docker image locally and then access my application via localhost (I left out any details because for the moment I don't think they are necessary).</p>
  <p>Now the problem is that I would also like to create an artifact in the gitlab-ci pipeline with the same Dockerfile. This artifact basically is the built application which is then processed later on.</p>
  <p>How can I &quot;copy&quot; the application folder from inside the Dockerimage to the gitlab-ci environment?</p>
  <p>Edit: I found</p>
  <pre><code>script:
      - docker container create --name dummy ${IMAGE}
      - docker cp dummy:/usr/share/nginx/html web
      - docker rm -f dummy
  artifacts:
      paths:
          - web
  </code></pre>
  <p>to be a solution.</p>