jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-63032] Docker Pipeline v1.23 misbehaves - returns the whole command not just the output

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

Description

When I tried to get container id of docker container, I am getting the whole command not just the output. I just want to get container id alone.

And it is working fine in earlier version - Docker Pipeline 1.17.

Command:

runArguments = --name "PR_POPWEB_Master-47-tests-1-mssql" --label ephemeral --label mssql --label "jenkins_job_name=PR_POPWEB_Master" --label "jenkins_build_id=47" -e sa_password="{password}" -e ACCEPT_EULA="Y" --mount type=volume,source=PR_POPWEB_Master-47-tests-1-mssql_volume,destination=C:\Sql_Backup\

def dockerImage = docker.image("microsoft/mssql-server-windows-developer:2016-sp1")

containerInfo.container = dockerImage.run(runArguments) 

containerInfo.containerID = containerInfo.container.id

Error: Ideally, I should get below highlighted id alone. Instead I am getting {cmd} + {output}

E:\Jenkins\workspace\PR_POPWEB_Master>docker run -d --name "PR_POPWEB_Master-47-tests-1-mssql" --label ephemeral --label mssql --label "jenkins_job_name=PR_POPWEB_Master" --label "jenkins_build_id=47" -e sa_password="{password}" -e ACCEPT_EULA="Y" --mount type=volume,source=PR_POPWEB_Master-47-tests-1-mssql_volume,destination=C:\Sql_Backup\ microsoft/mssql-server-windows-developer:2016-sp1 0b5bdfbc710079b9d675def2a562b479662f96fd342ef920e0eb7fd575efd020

---
Originally reported by alavudeen_rafiq, imported from: Docker Pipeline v1.23 misbehaves - returns the whole command not just the output


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

Raw content of original issue

When I tried to get container id of docker container, I am getting the whole command not just the output. I just want to get container id alone.

And it is working fine in earlier version - Docker Pipeline 1.17.

Command:

runArguments = --name "PR_POPWEB_Master-47-tests-1-mssql" --label ephemeral --label mssql --label "jenkins_job_name=PR_POPWEB_Master" --label "jenkins_build_id=47" -e sa_password="{password}" -e ACCEPT_EULA="Y" --mount type=volume,source=PR_POPWEB_Master-47-tests-1-mssql_volume,destination=C:\Sql_Backup\

def dockerImage = docker.image("microsoft/mssql-server-windows-developer:2016-sp1")

containerInfo.container = dockerImage.run(runArguments) 

containerInfo.containerID = containerInfo.container.id

Error: Ideally, I should get below highlighted id alone. Instead I am getting {cmd} + {output}
E:\Jenkins\workspace\PR_POPWEB_Master>docker run -d --name "PR_POPWEB_Master-47-tests-1-mssql" --label ephemeral --label mssql --label "jenkins_job_name=PR_POPWEB_Master" --label "jenkins_build_id=47" -e sa_password="{password}" -e ACCEPT_EULA="Y" --mount type=volume,source=PR_POPWEB_Master-47-tests-1-mssql_volume,destination=C:\Sql_Backup\ microsoft/mssql-server-windows-developer:2016-sp1 0b5bdfbc710079b9d675def2a562b479662f96fd342ef920e0eb7fd575efd020

  • environment: Jenkins 1.235

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.