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

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

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved: