-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 1.625.3
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host.
eg:
08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu HOME=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh
For reference, when I pull the envs from the container running locally, i get this back for path and home
PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOME=/root
I don't think that it should include PATH or HOME, much like how JENKINS-30113 excluded path, but for some reason this was left in here.
- links to
[JENKINS-32393] PATH and HOME are being overwritten when executing command
Description |
Original:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env .. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
New:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
Description |
Original:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
New:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} For reference, when I pull the envs from the container running locally, i get this back for path {{code}} PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin {{code}} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
Description |
Original:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} For reference, when I pull the envs from the container running locally, i get this back for path {{code}} PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin {{code}} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
New:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} For reference, when I pull the envs from the container running locally, i get this back for path {code} PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin {code} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
Summary | Original: PATH is being overwritten when executing command | New: PATH and HOME are being overwritten when executing command |
Description |
Original:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} For reference, when I pull the envs from the container running locally, i get this back for path {code} PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin {code} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
New:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu HOME=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} For reference, when I pull the envs from the container running locally, i get this back for path {code} PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin {code} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
Description |
Original:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu HOME=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} For reference, when I pull the envs from the container running locally, i get this back for path {code} PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin {code} I don't think that it should include PATH, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
New:
when using the docker-custom-build-environment plugin, when it executes a bash script, it overwrites the PATH in the container with the PATH from the host. eg: {code} 08:57:37 [docker-ec2-cloud] $ docker exec --tty --user 1000: 2bd008eb80469148feb0bb3c6095e2731a755385abbedf0262f74b33f3cb46e9 env ... PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu HOME=/home/ubuntu ... /bin/bash /tmp/hudson4321343385196666792.sh {code} For reference, when I pull the envs from the container running locally, i get this back for path and home {code} PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOME=/root {code} I don't think that it should include PATH or HOME, much like how JENKINS-30113 excluded path, but for some reason this was left [in here|https://github.com/jenkinsci/docker-custom-build-environment-plugin/blame/master/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerDecoratedLauncher.java#L63]. |
Remote Link | New: This issue links to "PR (Web Link)" [ 14008 ] |
Priority | Original: Critical [ 2 ] | New: Major [ 3 ] |
Workflow | Original: JNJira [ 168007 ] | New: JNJira + In-Review [ 182934 ] |
Attachment | New: workaround.png [ 34837 ] |