Docker pipeline plugin

27 views
Skip to first unread message

Hung Do

unread,
Jan 2, 2018, 6:06:17 AM1/2/18
to Jenkins Users
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
Reply all
Reply to author
Forward
0 new messages