5

I was reading about docker . I have understood that the platform helps in removing dependencies between different software life cycles by combining the dependencies and the software together.

In the website of docker it was written that it is light weight , I didn't get that point as how it can be light weight when it has all the dependencies packaged along with it?

If I have multiple containers in my system that uses the same dependency i.e say we use the same external library in all the containers , will that dependency be installed again and again for all the containers??

I am new to Docker and thus any help would be great to me.

kkk
  • 1,850
  • 1
  • 25
  • 45
  • 2
    Related (duplicate?): [How is Docker different from a normal virtual machine?](http://stackoverflow.com/q/16047306/744178) – jwodder Jan 10 '16 at 03:06
  • @jwodder It is not duplicate , I am asking how it is light weight and how multiple containers share the same dependency , if they do. – kkk Jan 10 '16 at 03:09
  • By "light weight", this is meant to mean relative to a virtual machine. – Vaughn Cato Jan 10 '16 at 03:23

1 Answers1

9

docker is sometimes described as "light weight" in comparison to virtual machines because it:

  • does not boot a separate OS per VM and is therefore faster to start/stop
  • In most scenarios requires less disk space due to sharing of common layers across images
  • Again due to the image layering, incremental deployments of new app versions are smaller and therefore faster than VMs
  • Shares a kernel across containers and therefore uses less memory

Of course this is largely marketing speak, "light weight" is neither technical nor specific. Take it with a grain of salt.

If I have multiple containers in my system that uses the same dependency i.e say we use the same external library in all the containers , will that dependency be installed again and again for all the containers??

If you do it properly, your multiple containers will share a common base layer and therefore not have multiple copies of those external libraries occupying disk space.

I have one more question , If I have a number of micro services , then will each micro service take a container ??

Yes, generally you have one main process per container, and a microservice is an independent process.

Peter Lyons
  • 142,938
  • 30
  • 279
  • 274
  • I have one more question , If I have a number of micro services , then will each micro service take a container ?? If you can provide a link or an example explaining how docker works for micro services that would be really helpful. – kkk Jan 10 '16 at 03:41