jenkinsci / jenkinsci/docker-workflow-plugin
[JENKINS-57168] withDockerRegistry problems in Declarative Pipeline
- Dominant language
- Java
- Stars
- 527
- Forks
- 422
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
Hello,
When i am using the pipeline like that
node('master')
{ withDockerServer([uri: "tcp://xxx.97.131.33:4243"]) {
withDockerRegistry([credentialsId: 'xxx-docker', url: "https://xxx.got.xxx.net:18666/"]) {
sh "docker images"
}
}
}
It worked, but if i try to user in the declarative pipeline
stage ('Build container and push the image to repository') { agent any steps { script{ docker.withServer('tcp://xxx.97.131.33:4243') { docker.withRegistry('https://${DOCKER_REGISTRY}', 'xxxx-docker'){ image = docker.build "${PROJECT_NAME}:${BUILD_ID}", "--no-cache --build-arg http_proxy=${HTTP_PROXY} --build-arg https_proxy=${HTTP_PROXY} ." image.push() image.push('latest') } } } } }
i got a timeout, like that
$ docker login -u xxxx-qa -p ******** https://xxxx.got.xxx.net:18666WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon:
I appreciate, if you can help me with that
---
Originally reported by sbj, imported from: withDockerRegistry problems in Declarative Pipeline
Raw content of original issue
Hello,
When i am using the pipeline like that
node('master')
{ withDockerServer([uri: "tcp://xxx.97.131.33:4243"]) {
withDockerRegistry([credentialsId: 'xxx-docker', url: "https://xxx.got.xxx.net:18666/"]) {
sh "docker images"
}
}
}
It worked, but if i try to user in the declarative pipeline
stage ('Build container and push the image to repository') { agent any steps { script{ docker.withServer('tcp://xxx.97.131.33:4243') { docker.withRegistry('https://${DOCKER_REGISTRY}', 'xxxx-docker'){ image = docker.build "${PROJECT_NAME}:${BUILD_ID}", "--no-cache --build-arg http_proxy=${HTTP_PROXY} --build-arg https_proxy=${HTTP_PROXY} ." image.push() image.push('latest') } } } } }
i got a timeout, like that
$ docker login -u xxxx-qa -p ******** https://xxxx.got.xxx.net:18666WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: <HTML><HEAD>
I appreciate, if you can help me with that
- environment:
Latest version of plugins and jenkins
Contributor guide
Assessment
This issue has not been assessed yet.