jenkinsci / jenkinsci/docker-workflow-plugin

[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

Open
#687 1 comment 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

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 ''. Error: docker: Error response from daemon: Mounts denied: The paths /home/jenkins/agent/workspace/@​tmp and /home/jenkins/agent/workspace/ 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. 

---
Originally reported by zmarffy, imported from: 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


  • status: Open
  • priority: Minor
  • component(s): docker-workflow-plugin
  • label(s): docker, docker-workflow-plugin, plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-07

Raw content of original issue

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. 

  • environment: Jenkins 2.330, Dockerized agent on macOS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.