title: How to use multiple image tags with docker-compose
body: <p>According to <a href="https://github.com/docker/compose/issues/4976" rel="noreferrer">this</a> and <a href="https://github.com/docker/compose/issues/213" rel="noreferrer">this</a> GitHub issues, currently there is no native way how to supply multiple tags for a service's image when using <code>docker-compose</code> to build one or multiple images.</p>
  
  <p>My use case for this would be to build images defined in a <code>docker-compose.yml</code> file and tag them once with some customized tag (e.g. some build no. or date or similar) and once as <code>latest</code>.</p>
  
  <p>While this can be easily achieved with plain <code>docker</code> using <a href="https://docs.docker.com/engine/reference/commandline/tag/" rel="noreferrer">docker tag</a>, <code>docker-compose</code> only allows to set one single tag in the <a href="https://docs.docker.com/compose/compose-file/#image" rel="noreferrer">image key</a>. Using <code>docker tag</code> together with <code>docker-compose</code> is not an option for me since I want to keep all my docker-related definitions in the <code>docker-compose.yml</code> file and not copy them over into my build script.</p>
  
  <p>What would be a decent work-around to achieve setting of multiple tags with <code>docker-compose</code> and without having to hardcode/copy the image names first?</p>