LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-07-2021, 04:55 PM   #1
chomwitt
Member
 
Registered: Jul 2020
Location: Hellas
Distribution: Devuan+XFCE
Posts: 53

Rep: Reputation: Disabled
Are containers as overprovisioned guests?


A story-joke i've heard from a friend:
Quote:
' container technologies remind me of inviting someone in your home and .... surprise he/she comes with not one or two basic luggage (clothes,towels etc) but with his favorite foods, his favorite chair, his favorite bed , his favorite table , his favorite tv etc. And why not his favorite room! '
So without being expert on container , but understanding their basic function i wonder if that jokes contains a truth or not.
 
Old 01-07-2021, 05:22 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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.
 
1 members found this post helpful.
Old 01-07-2021, 07:54 PM   #3
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
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")
This would be a crazy amount of space.
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')"
hello world
$ docker ps -a --size
929797bb8f82   python        "python -c 'print('h…"   17 seconds ago   Exited (0) 16 seconds ago                                                        recursing_goldberg   157kB (virtual 885MB)
Ok, 885MB + 157KB

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
hello world # x9
$ docker ps -a --size
a8f733dffb92   python        "python -c 'print('h…"   5 seconds ago   Exited (0) 4 seconds ago                                                        elated_pare                157kB (virtual 885MB)
69368fa7f82e   python        "python -c 'print('h…"   6 seconds ago   Exited (0) 5 seconds ago                                                        gracious_perlman           157kB (virtual 885MB)
ddcfc455799f   python        "python -c 'print('h…"   6 seconds ago   Exited (0) 5 seconds ago                                                        peaceful_galileo           157kB (virtual 885MB)
34fb4c3beb7b   python        "python -c 'print('h…"   7 seconds ago   Exited (0) 6 seconds ago                                                        tender_edison              157kB (virtual 885MB)
a41ed1a612bf   python        "python -c 'print('h…"   7 seconds ago   Exited (0) 6 seconds ago                                                        charming_galileo           157kB (virtual 885MB)
2aca072f58bc   python        "python -c 'print('h…"   8 seconds ago   Exited (0) 7 seconds ago                                                        upbeat_tharp               157kB (virtual 885MB)
7a79147f19bf   python        "python -c 'print('h…"   8 seconds ago   Exited (0) 7 seconds ago                                                        condescending_hopper       157kB (virtual 885MB)
e3ba41e952d4   python        "python -c 'print('h…"   9 seconds ago   Exited (0) 8 seconds ago                                                        elated_kapitsa             157kB (virtual 885MB)
bd14d06bedd7   python        "python -c 'print('h…"   9 seconds ago   Exited (0) 9 seconds ago                                                        compassionate_archimedes   157kB (virtual 885MB)
929797bb8f82   python        "python -c 'print('h…"   2 minutes ago   Exited (0) 2 minutes ago                                                        recursing_goldberg         157kB (virtual 885MB)
Here's the big question.
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.
 
1 members found this post helpful.
  


Reply

Tags
container



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Everything You Need to Know about Linux Containers, Part II: Working with Linux Containers (LXC) LXer Syndicated Linux News 0 08-27-2018 01:53 PM
LXer: Containers Running Containers with LinuxKit LXer Syndicated Linux News 0 06-09-2017 06:52 AM
LXer: Containers running Containers LXer Syndicated Linux News 0 04-30-2017 04:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration