I have an inbound agent running on macOS. Its Dockerfile is as follows.
COPY --from=docker /usr/local/bin/docker /usr/local/bin/
RUN mkdir /usr/local/.docker/
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:
I believe the issue stems from this code being incorrect.