I am new using Docker, and I got the doubt of using one image base for my stack or I have to define each image depending on my needs.
For example, reading a blog about creating a website using docker the author suggests the following Stack:
Image taken from http://project-webdev.blogspot.de/2015/05/create-site-based-on-docker-part4-docker-container-architecture.html
Now, seen the structure, If we have base images in the Docker registry for technologies as mongoDB, io.JS, nginx, Why on this examples we do not use those images insted of using a single Docker base image for everything?
i suppose it depends on the application but in this case you are right it does not make sense to have a large base image.
From my understanding, the author created a base image and then built a lot of other images from that base image. When you build an image for docker, there are a lot of intermediary images created so if the base image is the same, it could be shared and potentially save some memory on your machine.
but i don't think it makes any difference for when you run the containers. each container is independent and they essentially only share the linux kernel. and it's actually really bad because the base image is huge in this case and it takes a lot of resource to spawn up a container from an image like this. the dedicated images for each service are much smaller and take up much less resource for when you start containers from them. so yea, whatever memory you could save from building a large base image is not going to be worth it.