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

Image.inside fails for images specifying ENTRYPOINT

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Alvaro Lobato found that inside fails with a cryptic error when trying to run images specifying ENTRYPOINT. For example this causes this to fail, which is confusing since for purposes of using Image.inside it makes no sense to be running copy_reference_files and associated code; the way this image is normally designed to work for command-line execution is inappropriate.

        Attachments

          Issue Links

            Activity

            Hide
            hogarthj James Hogarth added a comment - - edited

            It's not much nicer but as a workaround you can do:

            docker.image('<image>').withRun('--') { con ->
                  sh "docker exec ${con.id} <command>"
                }
            

            This then has the same behavior as docker.image().inside() as before with ENTRYPOINT being executed (so things like systemd or a similar reaper will run) ...

            There's also JENKINS-26178 of course to be able to exec in a running container which would work around this, if it gets implemented.

            Show
            hogarthj James Hogarth added a comment - - edited It's not much nicer but as a workaround you can do: docker.image( '<image>' ).withRun( '--' ) { con -> sh "docker exec ${con.id} <command>" } This then has the same behavior as docker.image().inside() as before with ENTRYPOINT being executed (so things like systemd or a similar reaper will run) ... There's also JENKINS-26178 of course to be able to exec in a running container which would work around this, if it gets implemented.
            Hide
            hogarthj James Hogarth added a comment - - edited

            Reopening to track as it breaks people's workflow ...

            There is a fresh PR to add Image.exec() {} to provide access to am inside() style behaviour without the ENTRYPOINT override

            Show
            hogarthj James Hogarth added a comment - - edited Reopening to track as it breaks people's workflow ... There is a fresh PR to add Image.exec() {} to provide access to am inside() style behaviour without the ENTRYPOINT override
            Hide
            jglick Jesse Glick added a comment -

            The originally filed issue was fixed with the specified commit. Please do not reopen.

            Show
            jglick Jesse Glick added a comment - The originally filed issue was fixed with the specified commit. Please do not reopen.
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            Since Jesse is rather terse in his comment, what he really means is that the regression people reported is currently tracked as JENKINS-39748, so if you are affected by this, please follow that issue.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - Since Jesse is rather terse in his comment, what he really means is that the regression people reported is currently tracked as JENKINS-39748 , so if you are affected by this, please follow that issue.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nicolas De Loof
            Path:
            src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java
            src/test/java/org/jenkinsci/plugins/docker/workflow/DockerDSLTest.java
            http://jenkins-ci.org/commit/docker-workflow-plugin/8367ac4c170bc822eb24ef94b8afb0de4881d1f6
            Log:
            Revert "[FIXED JENKINS-37987] Override ENTRYPOINT, not just command, for WithContainerStep."

            This reverts commit 5b0586d6bd87fc4f108693ee9361252a24eb37d1.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java src/test/java/org/jenkinsci/plugins/docker/workflow/DockerDSLTest.java http://jenkins-ci.org/commit/docker-workflow-plugin/8367ac4c170bc822eb24ef94b8afb0de4881d1f6 Log: Revert " [FIXED JENKINS-37987] Override ENTRYPOINT, not just command, for WithContainerStep." This reverts commit 5b0586d6bd87fc4f108693ee9361252a24eb37d1.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: