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

docker.inside() breaks container environment.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • docker-workflow-plugin
    • None
    • docker-workflow 1.10

      We have PATH set on our build slaves (via configure -> Node properties -> Environment Variables) that won't work in most docker containers.  Specifically, we use /usr/local/bin:/a/bin.  Note how /usr/bin and /bin aren't in the PATH (which is where cat usually is located.

      Normally, the docker.inside() command's docker run isn't setting the -e PATH=... flag.  But every so often it uses the PATH from the build slave configuration which causes the docker run to not find cat

       

      docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"cat\": executable file not found in $PATH".

       

      I was able to track this down by modifying docker-workflow to not mask the PATH: https://github.com/jenkinsci/docker-workflow-plugin/pull/96

      I don't know what the expected behavior (overriding the PATH on a container seems like a "Bad Idea", since the container may-or-may-not be in LSB/POSIX layout) is supposed to be.

      It is clear that this random flipping between behaviors is bad.

          [JENKINS-43590] docker.inside() breaks container environment.

          Christian Höltje created issue -
          Christian Höltje made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Christian Höltje made changes -
          Summary Original: docker.inside()'s -e flags are random New: docker.inside() ENV is semi-random
          Christian Höltje made changes -
          Summary Original: docker.inside() ENV is semi-random New: docker.inside() breaks container environment.
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-36776 [ JENKINS-36776 ]
          Allan BURDAJEWICZ made changes -
          Link New: This issue relates to JENKINS-49076 [ JENKINS-49076 ]
          Allan BURDAJEWICZ made changes -
          Link New: This issue relates to JENKINS-40484 [ JENKINS-40484 ]

            Unassigned Unassigned
            docwhat Christian Höltje
            Votes:
            12 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated: