Is it okay to run a docker container inside another docker container? Please explain if there are any cons.

Upto what depth is it advisable to go. I need to do this primarily for security concerns.


  • Looking back at this question after one year. I realise how stupid this question is – Dheeraj M Pai Nov 6 '19 at 15:16

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.