• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • docker-workflow-plugin
    • None
    • Jenkins Core 2.73

      When running a build inside a docker container, some commands don't work because they rely on the user being properly set. For example, ssh doesn't work with the following error:

       

      No user exists for uid 150.

       

      I think this could be solved by append to passwd on container startup, something like this (untested, for proof of concept):

      if [ "$(id -u)" != "0" ]; then

          echo "jenkins:x:$(id -u):$(id -g):Jenkins:${HOME}:/sbin/nologin" >> /etc/passwd

      fi

          [JENKINS-47026] User not completely set in docker containers

          Eric Dahlseng created issue -
          Nicola Worthington made changes -
          Link New: This issue relates to JENKINS-31944 [ JENKINS-31944 ]
          Waldek M made changes -
          Attachment New: build_log.txt [ 41383 ]
          Waldek M made changes -
          Attachment New: Jenkinsfile [ 41384 ]
          Nicolas De Loof made changes -
          Component/s New: declarative-pipeline-when-conditions-plugin [ 23168 ]
          Component/s Original: docker [ 20834 ]
          Nicolas De Loof made changes -
          Component/s New: docker-workflow-plugin [ 20625 ]
          Component/s Original: declarative-pipeline-when-conditions-plugin [ 23168 ]
          Waldek M made changes -
          Link New: This issue relates to JENKINS-49416 [ JENKINS-49416 ]
          Michael Slattery made changes -
          Comment [ My above workaround can further be improved by adding "-v jenkins_etc:/etc" to the Jenkins docker run command line. That way /etc/passwd will be available to all agent containers.

          And if you do that, you don't need the {{environment{}}} variables I have above.  Unfortunately, you'll still need to override $HOME. ]
          Nicolas De Loof made changes -
          Assignee Original: Nicolas De Loof [ ndeloof ]

            Unassigned Unassigned
            edahlseng Eric Dahlseng
            Votes:
            6 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: