Multiple images inside one container

Viewed 39956

So, here is the problem, I need to do some development and for that I need following packages:

  1. MongoDb
  2. NodeJs
  3. Nginx
  4. RabbitMq
  5. Redis

One option is that I take a Ubuntu image, create a container and start installing them one by one and done, start my server, and expose the ports.

But this can easily be done in a virtual box also, and it will not going to use the power of Docker. So for that I have to start building my own image with these packages. Now here is the question if I start writing my Dockerfile and if place the commands to download the Node js (and others) inside of it, this again becomes the same thing like virtualization.

What I need is that I start from Ubuntu and keep on adding the references of MongoDb, NodeJs, RabbitMq, Nginx and Redis inside the Dockerfile and finally expose the respective ports out.

Here are the queries I have:

  1. Is this possible? Like adding the refrences of other images inside the Dockerfile when you are starting FROM one base image.
  2. If yes then how?
  3. Also is this the correct practice or not?
  4. How to do these kind of things in Docker ?

Thanks in advance.

1 Answers
Related