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

withContainer DecoratedLauncher not executing using withEndpoints env variables

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Which means that these variables (DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH) are not part of the docker exec environment, meaning you cannot use a remote server. Of course the whole step probably will not work with a remote server either (since the workspace bind-mount is unlikely to be correct).

      The quick fix would be to set these three if present in the host environment.

      Probably it is incorrect for the ProcStarter used for docker exec to be suppressing environment variables from the host, but need to investigate why it was done this way to begin with. Can they "leak" into the container process? Perhaps an inherited JENKINS_SERVER_COOKIE was the problem: if you stop the build inside docker exec, you want the kill signal sent only via the decorated launcher's kill method, so that the shell step inside the container receives SIGTERM and is given a chance to shut down cleanly; you do not want docker exec itself to receive SIGTERM.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Testing confirms that environment variables exposed to docker exec are not transferred to the process created in the container.

            Show
            jglick Jesse Glick added a comment - Testing confirms that environment variables exposed to docker exec are not transferred to the process created in the container.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Vincent Latombe
            Path:
            src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java
            src/test/java/org/jenkinsci/plugins/docker/workflow/WithContainerStepTest.java
            http://jenkins-ci.org/commit/docker-workflow-plugin/ad7edee380cc3bca4f43f836f4274e7e0bebf14a
            Log:
            Merge pull request #17 from Vlatombe/docker-with-node-environment

            [FIXED JENKINS-28611] Execute docker with the node environment

            Compare: https://github.com/jenkinsci/docker-workflow-plugin/compare/4a44d4d934d9...ad7edee380cc

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java src/test/java/org/jenkinsci/plugins/docker/workflow/WithContainerStepTest.java http://jenkins-ci.org/commit/docker-workflow-plugin/ad7edee380cc3bca4f43f836f4274e7e0bebf14a Log: Merge pull request #17 from Vlatombe/docker-with-node-environment [FIXED JENKINS-28611] Execute docker with the node environment Compare: https://github.com/jenkinsci/docker-workflow-plugin/compare/4a44d4d934d9...ad7edee380cc

              People

              • Assignee:
                vlatombe Vincent Latombe
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: