Instead of using Docker/dind Kaniko should be used to build Docker images.
This is easier and safer than Docker in Docker.