Adding tags to docker image from jenkins

后端 未结 3 1797

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

3条回答
  •  天命终不由人
    2020-12-20 18:09

    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.

提交回复
热议问题