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

docker.inside() breaks container environment.

XMLWordPrintable

    • 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.

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

              Created:
              Updated: