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

docker.inside fails to run `docker` on a docker4mac ssh slave

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      How to reproduce :

      1. setup a docker4mac machine as a ssh slave
      2. run this pipeline :
        node ('slave'){
                docker.image("ubuntu").inside{ 
                    sh 'ps -ef'
                }
        }
        

        shell step fail to run docker command.

      This is expected as docker4mac client binary is installed under /usr/local/bin which isn't part of non-interactive ssh session PATH. So, never mind, let's declare a docker tool installation

      node ('slave'){
          docker.withTool("docker4mac"){ 
              docker.image("ubuntu").inside{ 
                  sh 'ps -ef'
              }
          }
      }
      

      Still falling.

      Not sure about possible workaround.

        Attachments

          Issue Links

            Activity

            Hide
            ndeloof Nicolas De Loof added a comment -

            not sure why `docker` is not found in PATH (which is correctly set in ProcStarter to include `/usr/local/bin`).
            I wonder WithContainerStep.Decorator#decorate does not use DockerTool.getExecutable as other components in this plugin do

            Show
            ndeloof Nicolas De Loof added a comment - not sure why `docker` is not found in PATH (which is correctly set in ProcStarter to include `/usr/local/bin`). I wonder WithContainerStep.Decorator#decorate does not use DockerTool.getExecutable as other components in this plugin do
            Hide
            ndeloof Nicolas De Loof added a comment -

            Something weird is docker-pipeline run `docker inspect` just before the sh step :

            + docker inspect -f . ubuntu
            .
            

            so `docker` is well found in PATH, but fore some weird reason the LauncherDecorator to prepend `docker exec ...` is breaking something

            Show
            ndeloof Nicolas De Loof added a comment - Something weird is docker-pipeline run `docker inspect` just before the sh step : + docker inspect -f . ubuntu . so `docker` is well found in PATH, but fore some weird reason the LauncherDecorator to prepend `docker exec ...` is breaking something

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                ndeloof Nicolas De Loof
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: