Running a container inside of a container does not increase security. While you need to run the outer container in privileged mode to do so, the outer capsulation is almost worn out. So in the end it's the same level of security as running the inner container directly.
But it also makes things way more complicating. Just think about volume mounts to the inner container, or making ports accessible to the host.
So, just like the previous writer says, it's no good idea IMHO.
Docker in docker has use cases but from a security perspective it's a bad idea since it requires that the docker container is run in privileged mode.
This allows the docker container to do almost everything the host can do.
For example modifying kernel parameters of the underlying host and accessing information from within other docker containers.
Running a container inside of a container does not increase security. While you need to run the outer container in privileged mode to do so, the outer capsulation is almost worn out. So in the end it's the same level of security as running the inner container directly.
But it also makes things way more complicating. Just think about volume mounts to the inner container, or making ports accessible to the host.
So, just like the previous writer says, it's no good idea IMHO.