Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50857

Docker agent on windows fails with Cannot run program "id"

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I'm trying to use a docker agent on windows in declarative pipeline. I can see the image is pulled but then fails as below

      [ply-widgets-project-pipelin-GORWBIPVPM5EWBJECA7BVJBSR5OVNCYISONJIELJYMXAG4YTMWPQ] Running shell script
      sh: sleep: command not found
      sh: sleep: command not found
      sh: sleep: command not found
      sh: sleep: command not found
      sh: sleep: command not found
      + docker inspect -f . 1234567.dkr.ecr.us-west-2.amazonaws.com/builds/jenkins-agent-node:windows-npm-5.8.0
      .
      Cannot run program "id": CreateProcess error=2, The system cannot find the file specified
      

       

      I'm using the following in my jenkinsfile for a stage

      agent {
          docker { 
              image '1234567.dkr.ecr.us-west-2.amazonaws.com/builds/jenkins-agent-node:windows-npm-5.8.0' 
              label 'windows&&docker' 
          }
      }
      

      While I don't think it matters in this case my registry is actually AWS ECR and the agent is a windows server 2016, in a previous stage the following is run to login to ECR

      powershell 'Get-ECRLoginCommand -region us-west-2 | select -ExpandProperty command | Invoke-Expression'
      

        Attachments

          Activity

          jonathank Jonathan Kuleff created issue -
          jonathank Jonathan Kuleff made changes -
          Field Original Value New Value
          Environment Windows 2016, Jenkins 2.89.4
          Summary Docker agent on windows with Cannot run program "id" Docker agent on windows fails with Cannot run program "id"
          jonathank Jonathan Kuleff made changes -
          Priority Minor [ 4 ] Critical [ 2 ]
          jonathank Jonathan Kuleff made changes -
          Environment Windows 2016, Jenkins 2.89.4 Windows Server Code 2016
          Jenkins 2.89.4
          Pipeline: Declarative 1.2.8
          jonathank Jonathan Kuleff made changes -
          Environment Windows Server Code 2016
          Jenkins 2.89.4
          Pipeline: Declarative 1.2.8
          Windows Server Core 2016
          Jenkins 2.89.4
          Pipeline: Declarative 1.2.8
          Hide
          jonathank Jonathan Kuleff added a comment -

          Andrew Bayer not sure if you are the right person to get this looked at by someone but would really appreciate if someone can look at this as docker agent for declarative pipeline is broken for windows containers.

          Show
          jonathank Jonathan Kuleff added a comment - Andrew Bayer not sure if you are the right person to get this looked at by someone but would really appreciate if someone can look at this as docker agent for declarative pipeline is broken for windows containers.
          abayer Andrew Bayer made changes -
          Component/s docker-workflow-plugin [ 20625 ]
          Component/s pipeline [ 21692 ]
          Hide
          abayer Andrew Bayer added a comment -

          I think that docker-workflow (which is what's used behind the scenes for a Docker agent in Declarative) doesn't support windows, but I could be wrong. I've moved this to the docker-workflow component.

          Show
          abayer Andrew Bayer added a comment - I think that docker-workflow (which is what's used behind the scenes for a Docker agent in Declarative) doesn't support windows, but I could be wrong. I've moved this to the docker-workflow component.
          Hide
          jonathank Jonathan Kuleff added a comment -

          thank you Andrew Bayer

          Show
          jonathank Jonathan Kuleff added a comment - thank you Andrew Bayer

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jonathank Jonathan Kuleff
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: