+1 for this issue.
Using JNLP shared agent on bare metal, when the agent container is started, only the workspace is mounted, the tool directory is not mounted to the agent, causing a file not found when trying to use the tool.
docker run -t -d -u 3000:3000 --group-add 3001 -w /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:rw -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat ubuntu
resulting in:
[eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA] Running shell script
+ mvn -version
/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: 2: /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: mvn: not found
The current behavior is to install the tools on the agent at the same scope, but let me think about it.