I have a jenkins instance (which actually runs inside docker) for my Continous Integration.
The jenkins server builds docker images on an external docker host, tests
As shown in this blog post you can add two tags with the push command like so:
stage('Push image') {
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
app.push("${env.BUILD_NUMBER}")
app.push("latest")
}
}
PS Mind you Jenkins folks if you're reading this a 3rd party blog post does NOT count as documentation. This could have been resolved MUCH quicker had this been properly documented.