{"id":2618,"date":"2017-12-16T22:04:34","date_gmt":"2017-12-16T22:04:34","guid":{"rendered":"http:\/\/blog.paranoidprofessor.com\/?p=2618"},"modified":"2017-12-16T22:04:34","modified_gmt":"2017-12-16T22:04:34","slug":"lightweight-virtualization-docker","status":"publish","type":"post","link":"https:\/\/blog.paranoidprofessor.com\/index.php\/2017\/12\/16\/lightweight-virtualization-docker\/","title":{"rendered":"lightweight virtualization &#8211; docker"},"content":{"rendered":"<p>Virtual machines can allow you better utilize the resources or make it possible to run multiple incompatible versions of the same software or even different operating systems. Virtual machines sound like the perfect solution, instead of a server that runs only database server or web server you can have a single server that runs both of them and more.<\/p>\n<p>There is actually one little downside to all of these virtual machines.\u00a0 Each one is actually running an entire operating system.\u00a0 This takes up more ram and more disk space than is strictly necessary.\u00a0 A single windows 7 installation could take 10gb disk space but four could take 40gb or more.<\/p>\n<p>It doesn&#8217;t take a mathematics genius to see this downside to just using virtual machines fairly clearly &#8211; the solution was to bring down virtualization to the application level.<\/p>\n<h2>Containers<\/h2>\n<p>This &#8220;application virtualization&#8221; was created as containers.\u00a0 These containers contain not only the application but it also bundles other required resources.\u00a0 These containers then are separated from each other in the operating system through the implementation of both <a href=\"https:\/\/en.wikipedia.org\/wiki\/Linux_namespaces\" target=\"_blank\" rel=\"noopener\">namespaces<\/a> and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cgroups\" target=\"_blank\" rel=\"noopener\">cgroup<\/a>&#8216;s inside the Linux kernel.<\/p>\n<p>The difference between container technology and virtual machines is that the containers use the host operating system for the application while the virtual machine has its own operating system.\u00a0 Thus the resources used by a container should always be less than any virtual machine.<\/p>\n<h2>Docker<\/h2>\n<p>Linux did create its own container technology (<a href=\"https:\/\/linuxcontainers.org\/lxd\/\" target=\"_blank\" rel=\"noopener\">LXC\/LXD<\/a>) but for most people a more recognizable container solution is <a href=\"https:\/\/www.docker.com\/\" target=\"_blank\" rel=\"noopener\">Docker<\/a>. Docker is a friendly command line container program which is more performent than using a VM but more importantly it also has a repository of containers that have been already been built. It is quite possible that the program that you want or need is already in a docker container.\u00a0 There are two different sets of precreated containers, official docker containers and community containers.<\/p>\n<p>Docker may have been originally developed on Linux but this awesome container technology can be run on either Linux or Windows &#8211; well, Windows 10 and Windows server 2016.<\/p>\n<p>Docker is basically just a command line program and because of that you can use all of the same commands on Windows as you do on Linux.\u00a0 Actually, if you really are a Windows aficionado you will be happy to learn that you can also use powershell command line as well with Docker.<\/p>\n<p>The installation process is really strait forward, rather than duplicate the instructions here are a few links for installing docker on Linux.<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"XXE6RGG6EL\"><p><a href=\"http:\/\/linuxbsdos.com\/2016\/12\/13\/how-to-install-docker-and-run-docker-containers-on-linux-mint-1818-1\/\">How to install Docker and run Docker containers on Linux Mint 18\/18.1<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/linuxbsdos.com\/2016\/12\/13\/how-to-install-docker-and-run-docker-containers-on-linux-mint-1818-1\/embed\/#?secret=XXE6RGG6EL\" data-secret=\"XXE6RGG6EL\" width=\"600\" height=\"338\" title=\"&#8220;How to install Docker and run Docker containers on Linux Mint 18\/18.1&#8221; &#8212; LinuxBSDos.com\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"i44CK7Bblf\"><p><a href=\"http:\/\/linuxbsdos.com\/2016\/12\/14\/how-to-install-docker-machine-on-linux-mint-18-and-18-1\/\">How to install Docker Machine on Linux Mint 18 and 18.1<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/linuxbsdos.com\/2016\/12\/14\/how-to-install-docker-machine-on-linux-mint-18-and-18-1\/embed\/#?secret=i44CK7Bblf\" data-secret=\"i44CK7Bblf\" width=\"600\" height=\"338\" title=\"&#8220;How to install Docker Machine on Linux Mint 18 and 18.1&#8221; &#8212; LinuxBSDos.com\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>I plan on doing a few more blog posts on actually using Docker, but for right now I will put up a link for a history of Linux containers.\u00a0 The solution of a program utilizing the host operating system but yet being (somewhat) segregated from all the other processes is not new.\u00a0 The solution for segregating a an application used to be a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Chroot\" target=\"_blank\" rel=\"noopener\">chroot<\/a>.<\/p>\n<h2>History<\/h2>\n<p><a href=\"https:\/\/dzone.com\/articles\/evolution-of-linux-containers-future\" target=\"_blank\" rel=\"noopener\">https:\/\/dzone.com\/articles\/evolution-of-linux-containers-future<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Virtual machines can allow you better utilize the resources or make it possible to run multiple incompatible versions of the same software or even different operating systems. Virtual machines sound like the perfect solution, instead of a server that runs &hellip; <a href=\"https:\/\/blog.paranoidprofessor.com\/index.php\/2017\/12\/16\/lightweight-virtualization-docker\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[91,85],"_links":{"self":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2618"}],"collection":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/comments?post=2618"}],"version-history":[{"count":8,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2618\/revisions"}],"predecessor-version":[{"id":2631,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2618\/revisions\/2631"}],"wp:attachment":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/media?parent=2618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/categories?post=2618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/tags?post=2618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}