jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-57168] withDockerRegistry problems in Declarative Pipeline

Open
#609 0 comments 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:critical resolution:unresolved
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


  • status: Open
  • priority: Critical
  • component(s): docker-workflow-plugin
  • label(s): docker, plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-07

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.