Here is my understanding / observation
devTools = docker.build(tag, "--pull -f .docker/dev-tools/Dockerfile .") command builds a docker image, image is built inside the docker-dind container. Subsequent sh command inside the devTools.inside() block gets executed inside the dynamically created container inside the docker-dind container. NPE happens during this shell execution inside the dynamically created container. As this shell command is getting executed with in a container created outside of kubernetes pod, container working directory is getting set to null.
Added a null check to avoid NPE, added unit test to test this usage and raised a PR.