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

Jenkins does not detect it's in a container on Docker for Mac

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • docker-workflow-plugin
    • None
    • Docker for Mac Version 17.12.0-ce-mac45 (21669)
      jenkins/jenkins and jenkinsci/blueocean

    Description

      When I try to follow the tutorial here, I get a log message saying that Jenkins seems to not be in a container.  I looked at the code and noticed that in this specific line, it shows the examples of what it expects the cgroup format to be.  On Docker for Mac, it adds "/docker-ce/" at the beginning. 

       

      13:name=systemd:/docker-ce/docker/9f198268ef07dc79b2e4e9d125ebe43bb689854991d5117ad1654e25844ead3f
      12:pids:/docker-ce/docker/9f198268ef07dc79b2e4e9d125ebe43bb689854991d5117ad1654e25844ead3f
      11:hugetlb:/docker-ce/docker/9f198268ef07dc79b2e4e9d125ebe43bb689854991d5117ad1654e25844ead3f
      10:net_prio:/docker-ce/docker/9f198268ef07dc79b2e4e9d125ebe43bb689854991d5117ad1654e25844ead3f

       

      I end up getting an error in the console output saying

      sh: can't create /var/jenkins_home/workspace@tmp/durable-070664e3/jenkins-log.txt: nonexistent directory sh: can't create /var/jenkins_home/workspace@tmp/durable-070664e3/jenkins-result.txt: nonexistent directory

       

       

      Because Jenkins thinks its not in a container, Jenkins doesn't run the --volumes-from tag when it creates the Docker container.  I don't know if this is the root cause but it was all I can notice.

      Attachments

        Issue Links

          Activity

            I think I've an updated regex here: https://www.debuggex.com/r/PPydlyVnmq4SNOP2

            simonmcc Simon McCartney added a comment - I think I've an updated regex here:  https://www.debuggex.com/r/PPydlyVnmq4SNOP2
            simonmcc Simon McCartney added a comment - And it looks like https://github.com/jenkinsci/docker-workflow-plugin/pull/128  fixes this

            Thanks Simon.  Appreciate the guidance.

            lcorcuera Lorenze Corcuera added a comment - Thanks Simon.  Appreciate the guidance.

            People

              ndeloof Nicolas De Loof
              lcorcuera Lorenze Corcuera
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: