The author of docker-in-docker suggested not to use this image for CI purposes here in this blog: jpetazzo/Using Docker-in-Docker for your CI or testing environment? Think twice
Why Jenkins uses docker-in-docker in Jenkins user Handbook(installing section)in the following link: Installing Jenkins(you can see it in step 4)
Why didn't they just use volume for using docker daemon as follows:
--volume /var/run/docker.sock:/var/run/docker.sock
Is there any specific reason for using docker-in-docker?
If you agree that it should have been done without using docker-in-docker, please tell me how to do it that way, actually I have already tried to do it with no luck and I came across another question here: How to find out which user is accessing /var/run/docker.sock that will cause permission denied error