Since Jenkins stores the shell scripts to execute in /tmp, that directory is mounted in the container.
This can cause subtle bugs if multiple Matrix job combinations are running on the same node and all writing to /tmp.
Ideally, only the script(s) that need to executed should be mounted into the container. But I'm not sure if its possible to identify that information.