Are containers as overprovisioned guests?
A story-joke i've heard from a friend:
Quote:
|
The idea is that an application container image, such as the ones you find on hub.docker.com, contains not only the application itself, for example a database or a web server, but also a minimal execution environment tailoured to the application. This execution environment is the food, chair, bed, table, TV that the guest brings.
The advantage of bringing the execution environment is the ability to run the container image whereever Docker is installed. Disadvantage: The execution environment makes the container heavier than just running the application on the container host, without containing it. This is the price you pay for containment. Note that there is another type of containers whose purpose is not encapsulating a single application but providing an almost complete operating system. They are similar to all-purpose virtual machines, but much more light-weight. The Linux Containers, LXD and OpenVZ technologies are in this category. |
That's a good question, it's yes and no, at least with docker
The default python image is 885MB. That's a lot! If you were just running Code:
print("Hello World") Let's see how much space that takes (scroll right to see the whole output) Code:
$ docker container run python python -c "print('hello world')" This means that when the container ran, it had a virtual size of 885MB and an actual size of 157KB. Let's create 9 more for a even 10 Code:
$ for i in {1..9}; do docker container run python python -c "print('hello world')"; done Are we using 8.5GB + 1.57MB, or are we using 885MB + 1.57MB? Any one of those containers can use anything in that huge image, but if you check, the file size used is only 886.57MB So yes, they each separately have their own house with a couch food etc.. But in a sense they're sharing the same house too and only take the space of a single house. |
All times are GMT -5. The time now is 06:14 AM. |