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

Jenkins reports that a Dockerized agent on macOS "does not seem to be running inside a container" when it is in fact running inside a container

XMLWordPrintable

      I have an inbound agent running on macOS. Its Dockerfile is as follows. 

      FROM jenkins/inbound-agent
       
      COPY --from=docker /usr/local/bin/docker /usr/local/bin/
      USER root
      RUN mkdir /usr/local/.docker/
      USER jenkins
      

       When using withDockerContainer, Jenkins says it "does not seem to be running inside a container". This is not true, and it causes volume mounts to fail.

      java.io.IOException: Failed to run image '<image id>'. Error: docker: Error response from daemon: Mounts denied: The paths /home/jenkins/agent/workspace/<job name>@tmp and /home/jenkins/agent/workspace/<job name> are not shared from OS X and are not known to Docker. You can configure shared paths from Docker -> Preferences... -> File Sharing. See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
      

      I believe the issue stems from this code being incorrect. 

            Unassigned Unassigned
            zmarffy Zeke Marffy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: