Docker pipeline plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Docker pipeline plugin

Hung Do
Hi everyone,

I'm struggling a little bit with the docker pipeline plugin,
the building of small image goes well, but when I try to push it to my private dockerhub registry, I get the following

[3-email_feature_jenkinsTest-5LSQUNLKW2A3IQQVQE7P6TOWAJPMB4NKMLQH3CFFATJHMGMXUSZQ] Running shell script
+ docker tag --force=true hungdo93/testatot registry.hub.docker.com/hungdo93/testatot:test
unknown flag
: --force
See 'docker tag --help'.
+ docker tag hungdo93/testatot registry.hub.docker.com/hungdo93/testatot:test

[3-email_feature_jenkinsTest-5LSQUNLKW2A3IQQVQE7P6TOWAJUJAUKMLQH3CFFATJHMGMXUSZQ] Running shell script
+ docker push registry.hub.docker.com/hungdo93/testatot:test
The push refers to a repository [registry.hub.docker.com/hungdo93/testatot]
2c55342d652e: Preparing
28baa3bk1903: Preparing
5b1e37e74377: Preparing
04a294je844e: Preparing
denied
: requested access to the resource is denied



This is the relevant part of my jenkinsfile

    def dockerImage
    stage
('build docker') {
        sh
"cp -R src/main/docker target/"
        sh
"cp target/*.war target/docker/"
        dockerImage
= docker.build('hungdo93/testatot', 'target/docker')
   
}

    stage
('publish docker') {
        docker
.withRegistry('https://registry.hub.docker.com/', 'docker-hub-hung') {
            dockerImage
.push 'test'
       
}
   
}
}



Ofcourse, I've made a username/password credentials id 'docker-hub-hung' and my private repo is hungdo93/testatot.
I have used the BlueOcean UI for this.

Thanks in advance!

Hung

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/02fbca3e-f045-4a16-9c74-e21ecc4b6ca0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.