Docker inside Docker?
2 min readNov 24, 2019
Several people are using docker containers and for crazy requirements they need install a docker tools inside it.
So in this post I will show you some reasons to avoid this strategy:
- Docker inside docker is like: How to run 2 process in the same docker container or dyno?
- Life goal of a docker container is be light an have the minimal required to run the main app. So, have a docker installed inside another docker container, is nowhere near to be light!!
- For test or proof of concept is ok, but I do not imagine to have a docker container running a nodejs app inside and a the same time a docker process
- If you have a docker installed inside another docker container, could you build an image inside this container?
- If you are using a docker private registry, and you want to execute docker commands inside container, you will need to perform a docker login inside :S, What if you are using google , aws or azure container registry, Will you install the required sdk? o_O
Related approaches
- Use a dockerized jenkins to perform docker commands :S
Advice
Avoid install docker tools inside a docker container. Let’s live your container in a light and minimal paradise!