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
- 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
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 jenkinsWhen 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
Assessment
This issue has not been assessed yet.