jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-52761] withDockerRegistry fails to login with complex password

Open
#580 4 comments 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

Jenkinsfile:

```
stage('Deliver') {
steps {
withDockerRegistry([credentialsId: 'docker-creds', url: '']) {
sh "docker push imagename"
}
}
}

```

Error:

```
$ docker login -u username -p ******** https://index.docker.io/v1/
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

```

Workaround:

Change Docker Hub password from something complex (e.g. "]GT~XMRZwWc6]dUg:NMs") to something very simple (e.g. "insecurepass"). Using a simple password that is very long (e.g. "verylongpasswordhere") works fine too.

`docker login` using complex password from the CLI works just fine.

---
Originally reported by gtirloni, imported from: withDockerRegistry fails to login with complex password


  • status: Open
  • priority: Minor
  • component(s): docker-workflow-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 5
  • imported: 2025-12-07

Raw content of original issue

Jenkinsfile:


    stage('Deliver') {

steps {
withDockerRegistry([credentialsId: 'docker-creds', url: '']) {
sh "docker push imagename"
}
}
}

Error:


$ docker login -u username -p ******** https://index.docker.io/v1/

WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

Workaround:

Change Docker Hub password from something complex (e.g. "]GT~XMRZwWc6]dUg:NMs") to something very simple (e.g. "insecurepass"). Using a simple password that is very long (e.g. "verylongpasswordhere") works fine too.

`docker login` using complex password from the CLI works just fine.

environment

```
Jenkins 2.134

Docker Pipeline 1.17
```

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.