Hi,

I'm new in Jenkins and executing a simple pipeline to get source from 
github, build image, test image and then push to local DTR

node {
    def app
    stage('Clone repository') {
        checkout scm
    }
    stage('Build image') {
        app = docker.build("test/hellonode")
    }
    stage('Test image') {
        app.inside {
            sh 'node --version'
        }
    }
    stage('Push image') {
        docker.withRegistry('http://<local-dtr>', credentials-dtr') {
          app.push("latest")
        }
    }
}

credentials-dtr are dfined inside the Jenkins --> Credentials --> System 
--> Global credentials (unrestricted)

The repository is created and I c
All works fine except the push

Pipeline] // withDockerContainer [Pipeline] } [Pipeline] // stage [Pipeline] 
stage [Pipeline] { (Push image) [Pipeline] withEnv [Pipeline] { [Pipeline] 
withDockerRegistry Wrote authentication to /var/jenkins_home/.dockercfg
[Pipeline] { [Pipeline] sh [docker-hellonode] Running shell script
+ docker tag --force=true toyota/hellonode <local-dtr>/xyz/hellonode:latest
unknown flag: --force
See 'docker tag --help'.
+ docker tag xyz/hellonode 
dockerdtrtest.toyota-europe.com/toyota/hellonode:latest
[Pipeline] sh [docker-hellonode] Running shell script
+ docker push <dtr-url>/xyz/hellonode:latest
The push refers to a repository 
[dockerdtrtest.toyota-europe.com/toyota/hellonode]
81c1e1c37cf0: Preparing
8455c73a933d: Preparing
41d2e9b986ab: Preparing
cdd2b48b0e16: Preparing
072b714c90b8: Preparing
ea2e97e9408f: Preparing
0da372da714b: Preparing
bf3841becf9d: Preparing
63866df00998: Preparing
2f9128310b77: Preparing
d9a5f9b8d5c2: Preparing
c01c63c6823d: Preparing
0da372da714b: Waiting
bf3841becf9d: Waiting
63866df00998: Waiting
2f9128310b77: Waiting
d9a5f9b8d5c2: Waiting
c01c63c6823d: Waiting
ea2e97e9408f: Waiting
denied: requested access to the resource is denied
[Pipeline] } [Pipeline] // withDockerRegistry [Pipeline] } [Pipeline] // 
withEnv [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node 
[Pipeline] 
End of Pipeline 


-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a1aceeed-38aa-46c1-910c-c6e161077889%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to