<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>containers Archives - Tech Chronicles</title>
	<atom:link href="http://kostacipo.stream/tag/containers/feed/" rel="self" type="application/rss+xml" />
	<link>https://kostacipo.stream/tag/containers/</link>
	<description>Ramblings of a Tech Dude</description>
	<lastBuildDate>Sat, 08 May 2021 23:48:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>

<image>
	<url>https://kostacipo.stream/wp-content/uploads/2019/12/cropped-profile-32x32.jpg</url>
	<title>containers Archives - Tech Chronicles</title>
	<link>https://kostacipo.stream/tag/containers/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Grype – Vulnerability Scanner For Container Images &#038; Filesystems</title>
		<link>http://kostacipo.stream/grype-vulnerability-scanner-for-container-images-filesystems/</link>
					<comments>http://kostacipo.stream/grype-vulnerability-scanner-for-container-images-filesystems/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Sat, 08 May 2021 23:48:31 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Vulnerability Analysis]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[vulnerability analysis]]></category>
		<category><![CDATA[vulnerability scanning]]></category>
		<guid isPermaLink="false">https://kostacipo.stream/?p=2092</guid>

					<description><![CDATA[<p>Grype is a vulnerability scanner for container images and filesystems with an easy to install binary that supports the packages for most major *nix based operating systems. Features of Grype Vulnerability Scanner For Container Images &#38; Filesystems Scan the contents of a container image or filesystem to find known vulnerabilities and find vulnerabilities for major [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/grype-vulnerability-scanner-for-container-images-filesystems/">Grype – Vulnerability Scanner For Container Images &#038; Filesystems</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4>Grype is a vulnerability scanner for container images and filesystems with an easy to install binary that supports the packages for most major *nix based operating systems.</h4>
<p><img fetchpriority="high" decoding="async" class="size-medium wp-image-5546 alignnone" src="https://cdn.darknet.org.uk/wp-content/uploads/2021/04/Grype-Vulnerability-Scanner-For-Container-Images-Filesystems-640x296.png" sizes="(max-width: 640px) 100vw, 640px" srcset="https://cdn.darknet.org.uk/wp-content/uploads/2021/04/Grype-Vulnerability-Scanner-For-Container-Images-Filesystems-640x296.png 640w, https://cdn.darknet.org.uk/wp-content/uploads/2021/04/Grype-Vulnerability-Scanner-For-Container-Images-Filesystems-1024x474.png 1024w, https://cdn.darknet.org.uk/wp-content/uploads/2021/04/Grype-Vulnerability-Scanner-For-Container-Images-Filesystems.png 1285w" alt="Grype - Vulnerability Scanner For Container Images &amp; Filesystems" width="640" height="296" /></p>
<h2>Features of Grype Vulnerability Scanner For Container Images &amp; Filesystems</h2>
<p>Scan the contents of a container image or filesystem to find known vulnerabilities and find vulnerabilities for major operating system packages in:</p>
<ul>
<li>Alpine</li>
<li>BusyBox</li>
<li>CentOS / Red Hat</li>
<li>Debian</li>
<li>Ubuntu</li>
</ul>
<p>Find vulnerabilities for language-specific packages:</p>
<ul>
<li>Ruby (Bundler)</li>
<li>Java (JARs, etc)</li>
<li>JavaScript (NPM/Yarn)</li>
<li>Python (Egg/Wheel)</li>
<li>Python pip/requirements.txt/setup.py listings</li>
</ul>
<p>Grype Supports Docker and OCI image formats.</p>
<h3>Using Grype Vulnerability Scanner For Container Images &amp; Filesystems</h3>
<p>To scan for vulnerabilities in an image:</p>
<p><code>grype &lt;image&gt;</code></p>
<p>Grype can scan a variety of sources beyond those found in Docker.</p>
<div class="crayon-pre">
<div id="crayon-60971100a73d9062039687-1" class="crayon-line"><code><span class="crayon-p"># scan a container image archive (from the result of `docker image save ...`, `podman save ...`, or `skopeo copy` commands)</span></code></div>
<div id="crayon-60971100a73d9062039687-2" class="crayon-line crayon-striped-line"><code><span class="crayon-e">grype </span><span class="crayon-v">path</span><span class="crayon-o">/</span><span class="crayon-st">to</span><span class="crayon-o">/</span><span class="crayon-v">image</span><span class="crayon-sy">.</span><span class="crayon-v">tar</span></code></div>
<div id="crayon-60971100a73d9062039687-3" class="crayon-line"></div>
<div id="crayon-60971100a73d9062039687-4" class="crayon-line crayon-striped-line"><code><span class="crayon-p"># scan a directory</span></code></div>
<div id="crayon-60971100a73d9062039687-5" class="crayon-line"><code><span class="crayon-e">grype </span><span class="crayon-v">dir</span><span class="crayon-o">:</span><span class="crayon-v">path</span><span class="crayon-o">/</span><span class="crayon-st">to</span><span class="crayon-o">/</span><span class="crayon-v">dir</span></code></div>
</div>
<p>The output format for Grype is configurable as well:<br />
<code><span class="crayon-v">grype</span> <span class="crayon-o">&lt;</span><span class="crayon-v">image</span><span class="crayon-o">&gt;</span> <span class="crayon-o">-</span><span class="crayon-v">o</span> <span class="crayon-o">&lt;</span><span class="crayon-v">format</span><span class="crayon-o">&gt;</span></code></p>
<p>Where the formats available are:</p>
<ul>
<li>json: Use this to get as much information out of Grype as possible!</li>
<li>cyclonedx: An XML report conforming to the CycloneDX 1.2 specification.</li>
<li>table: A columnar summary (default).</li>
</ul>
<h2>Getting started</h2>
<p><a href="https://github.com/anchore/grype#installation">Install the binary</a>, and make sure that <code>grype</code> is available in your path. To scan for vulnerabilities in an image:</p>
<pre><code>grype &lt;image&gt;
</code></pre>
<p>The above command scans for vulnerabilities that are visible in the container (i.e., the squashed representation of the image). To include software from all image layers in the vulnerability scan, regardless of its presence in the final image, provide <code>--scope all-layers</code>:</p>
<pre><code>grype &lt;image&gt; --scope all-layers
</code></pre>
<p>Grype can scan a variety of sources beyond those found in Docker.</p>
<pre><code># scan a container image archive (from the result of `docker image save ...`, `podman save ...`, or `skopeo copy` commands)
grype path/to/image.tar

# scan a directory
grype dir:path/to/dir
</code></pre>
<h3>Grype&#8217;s Database</h3>
<p>Grype pulls a database of vulnerabilities derived from the publicly available <a href="https://ancho.re/v1/service/feeds" rel="nofollow">Anchore Feed Service</a>. This database is updated at the beginning of each scan, but an update can also be triggered manually.</p>
<h2>Shell Completion</h2>
<p>Grype supplies shell completion through its CLI implementation (<a href="https://github.com/spf13/cobra/blob/master/shell_completions.md">cobra</a>). Generate the completion code for your shell by running one of the following commands:</p>
<ul>
<li><code>grype completion &lt;bash|fish&gt;</code></li>
<li><code>go run main.go completion &lt;bash|fish&gt;</code></li>
</ul>
<p>This will output a shell script to STDOUT, which can then be used as a completion script for Grype. Running one of the above commands with the <code>-h</code> or <code>--help</code> flags will provide instructions on how to do that for your chosen shell.</p>
<p>You can download Grype or read more <a href="https://github.com/anchore/grype">here</a>.</p>
<p>The post <a href="http://kostacipo.stream/grype-vulnerability-scanner-for-container-images-filesystems/">Grype – Vulnerability Scanner For Container Images &#038; Filesystems</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/grype-vulnerability-scanner-for-container-images-filesystems/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How Docker containers work</title>
		<link>http://kostacipo.stream/how-docker-containers-work/</link>
					<comments>http://kostacipo.stream/how-docker-containers-work/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Mon, 15 Feb 2021 10:28:52 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[docker]]></category>
		<guid isPermaLink="false">http://kostacipo.stream/?p=2040</guid>

					<description><![CDATA[<p>Here, we&#8217;ll look a bit at a Docker container&#8217;s lifecycle and how to manage containers. We&#8217;ll also look at how to think about configuring data storage and the network options for your containers. How to manage Docker containers A Docker container has a lifecycle that you can manage and track the state of the container. [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/how-docker-containers-work/">How Docker containers work</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Here, we&#8217;ll look a bit at a Docker container&#8217;s lifecycle and how to manage containers. We&#8217;ll also look at how to think about configuring data storage and the network options for your containers.</p>
<h2 id="how-to-manage-docker-containers">How to manage Docker containers</h2>
<p>A Docker container has a lifecycle that you can manage and track the state of the container.</p>
<p><span class="mx-imgBorder"> <img decoding="async" src="https://docs.microsoft.com/en-us/learn/modules/intro-to-docker-containers/media/4-docker-container-lifecycle.svg" alt="Diagram that shows the lifecycle of a container and the transition between the lifecycle phases." data-linktype="relative-path" /> </span></p>
<p>To place a container in the run state, use the run command. You can also restart a container that is already running. When restarting a container, the container receives a termination signal to enable any running processes to shut down gracefully before the container&#8217;s kernel is terminated.</p>
<p>A container is considered in a running state until it&#8217;s either paused, stopped, or killed. A container, however, may also exit from the run state by itself. A container can self-exit when the running process completes, or if the process goes into a fault state.</p>
<p>To pause a running container, use the pause command. This command suspends all processes in the container.</p>
<p>To stop a running container, use the stop command. The stop command enables the working process to shut down gracefully by sending it a termination signal. The container&#8217;s kernel terminates after the process shuts down.</p>
<p>To send a kill signal if you need to terminate the container, use the kill command. The running process doesn&#8217;t capture the kill signal, only the container&#8217;s kernel. This command will forcefully terminate the working process in the container.</p>
<p>Lastly, to remove containers that are in a stopped state, use the remove command. After removing a container, all data stored in the container gets destroyed.</p>
<h2 id="how-to-view-available-containers">How to view available containers</h2>
<p>To list running containers, run the <code>docker ps</code> command. To see all containers in all states, pass the <code>-a</code> argument.</p>
<p>Here is an example.</p>
<div id="code-try-0" class="codeHeader" data-bi-name="code-header"><span class="language">Console</span></div>
<pre class="has-inner-focus" tabindex="0"><code class="lang-console" data-author-content="docker ps -a
">docker ps -a
</code></pre>
<p>Here is the output from that command.</p>
<div id="code-try-1" class="codeHeader" data-bi-name="code-header"><span class="language">Output</span></div>
<pre class="has-inner-focus" tabindex="0"><code class="lang-output" data-author-content="CONTAINER ID    IMAGE        COMMAND         CREATED       STATUS           PORTS        NAMES
d93d40cc1ce9    tmp-ubuntu:latest  &quot;dotnet website.dll …&quot;  6 seconds ago    Up 5 seconds        8080/tcp      happy_wilbur
33a6cf71f7c1    tmp-ubuntu:latest  &quot;dotnet website.dll …&quot;  2 hours ago     Exited (0) 9 seconds ago            adoring_borg
">CONTAINER ID    IMAGE        COMMAND         CREATED       STATUS           PORTS        NAMES
d93d40cc1ce9    tmp-ubuntu:latest  "dotnet website.dll …"  6 seconds ago    Up 5 seconds        8080/tcp      happy_wilbur
33a6cf71f7c1    tmp-ubuntu:latest  "dotnet website.dll …"  2 hours ago     Exited (0) 9 seconds ago            adoring_borg
</code></pre>
<p>There are three items to review in the previous output:</p>
<ul>
<li>The image name listed in the <em>IMAGE</em> column. In this example, <em>tmp-ubuntu: latest</em>. Notice how you&#8217;re allowed to create more than one container from the same image. This feature is a powerful management feature that you use to enable scaling in your solutions.</li>
<li>The status of the container listed in the <em>STATUS</em> column. In this example, you have one container that is running, and one container that has exited. The container&#8217;s status usually is your first indicator of the health of the container.</li>
<li>The name of the container listed in the <em>NAMES</em> column. Apart from the container ID in the first column, containers will also receive a name. In this example, you didn&#8217;t explicitly provide a name for each container, and as a result, Docker gave the container a random name. To give a container an explicit name using the <code>--name</code> flag, use the run command.</li>
</ul>
<h3 id="why-are-containers-given-a-name">Why are containers given a name?</h3>
<p>This feature enables you to run multiple container instances of the same image. Container names are unique, which means if you specify a name, that name can&#8217;t be reused to create a new container. The only way to reuse a specific name is to remove the previous container.</p>
<h2 id="how-to-run-a-container">How to run a container</h2>
<p>To start a container, run the <code>docker run</code> command. You only need to specify the image to run with its name or ID to launch the container from the image. A container launched in this manner provides an interactive experience.</p>
<p>Here, to run the container with our website in the background, add the <code>-d</code> flag.</p>
<div id="code-try-2" class="codeHeader" data-bi-name="code-header"><span class="language">Console</span></div>
<pre class="has-inner-focus" tabindex="0"><code class="lang-console" data-author-content="docker run -d tmp-ubuntu
">docker run -d tmp-ubuntu
</code></pre>
<p>The command, in this case, only returns the ID of the new container.</p>
<p>After an image is specified to run, Docker finds the image, loads container from the image, and executes the command specified as the entry point. It&#8217;s at this point that the container is available for management.</p>
<h2 id="how-to-pause-a-container">How to pause a container</h2>
<p>To pause a container, run the <code>docker pause</code> command. Here is an example.</p>
<div id="code-try-3" class="codeHeader" data-bi-name="code-header"><span class="language">Console</span></div>
<pre class="has-inner-focus" tabindex="0"><code class="lang-console" data-author-content="docker pause happy_wilbur
">docker pause happy_wilbur
</code></pre>
<p>Pausing a container will suspend all processes. This command enables the container to continue processes at a later stage. The <code>docker unpause</code> command unsuspends all processes.</p>
<h3 id="how-to-restart-a-container">How to restart a container</h3>
<p>To restart containers, run the <code>docker restart</code> command. Here is an example.</p>
<div id="code-try-4" class="codeHeader" data-bi-name="code-header"><span class="language">Console</span></div>
<pre class="has-inner-focus" tabindex="0"><code class="lang-console" data-author-content="docker restart happy_wilbur
">docker restart happy_wilbur
</code></pre>
<p>The container receives a stop command, followed by a start command. If the container doesn&#8217;t respond to the stop command, then a kill signal is sent.</p>
<h3 id="how-to-stop-a-container">How to stop a container</h3>
<p>To stop a running container, run the <code>docker stop</code> command. Here is an example.</p>
<div id="code-try-5" class="codeHeader" data-bi-name="code-header"><span class="language">Console</span></div>
<pre class="has-inner-focus" tabindex="0"><code class="lang-console" data-author-content="docker stop happy_wilbur
">docker stop happy_wilbur
</code></pre>
<p>The stop command sends a termination signal to the container and the process running in the container.</p>
<h3 id="how-to-remove-a-container">How to remove a container</h3>
<p>To remove a container, run the <code>docker rm</code> command. Here is an example.</p>
<div id="code-try-6" class="codeHeader" data-bi-name="code-header"><span class="language">Console</span></div>
<pre class="has-inner-focus" tabindex="0"><code class="lang-console" data-author-content="docker rm happy_wilbur
">docker rm happy_wilbur
</code></pre>
<p>After you remove the container, all data in the container is destroyed. It&#8217;s essential to always consider containers as temporary when thinking about storing data.</p>
<h2 id="docker-container-storage-configuration">Docker container storage configuration</h2>
<p>As described earlier, always consider containers as temporary when the app in a container needs to store data.</p>
<p>Let&#8217;s assume your tracking portal creates a log file in a subfolder to the root of the app; that is, directly to the file system of the container. When your app writes data to the log file, the system writes the data to the writable container layer.</p>
<p>Even though this approach works, it, unfortunately, has several drawbacks.</p>
<ul>
<li>Container storage is temporary
<p>Your log file won&#8217;t persist between container instances. For example, let&#8217;s assume that you stop and remove the container. When you launch a new container instance, the new instance bases itself on the image specified, and all your previous data will be missing. Remember, all data in a container is destroyed with the container when you remove a container.</li>
<li>Container storage is coupled to the underlying host machine
<p>Accessing or moving the log file from the container is difficult to do as the container is coupled to the underlying host machine. You&#8217;ll have to connect to the container instance to access the file.</li>
<li>Container storage drives are less performant
<p>Containers implement a storage driver to allow your apps to write data. This driver introduces an extra abstraction to communicate with the host OS kernel and is less performant than writing directly to a host filesystem.</li>
</ul>
<p>Containers can make use of two options to persist data. The first option is to make use of <em>volumes</em>, and the second is <em>bind mounts</em>.</p>
<h3 id="what-is-a-volume">What is a volume?</h3>
<p>A volume is stored on the host filesystem at a specific folder location. Choose a folder where you know the data isn&#8217;t going to be modified by non-Docker processes.</p>
<p>Docker creates and manages the new volume by running the <code>docker volume create</code> command. This command can form part of our Dockerfile definition, which means that you can create volumes as part of the container creation process. Docker will create the volume if it doesn&#8217;t exist when you try to mount the volume into a container the first time.</p>
<p>Volumes are stored within directories on the host filesystem. Docker will mount and manage the volumes in the container. After mounting, these volumes are isolated from the host machine.</p>
<p>Multiple containers can simultaneously use the same volumes. Volumes also don&#8217;t get removed automatically when a container stops using the volume.</p>
<p>In this example, you can create a directory on our container host, and mount this volume into the container when you create the tracking portal container. When your tracking portal logs data, you can access this information via the container host&#8217;s filesystem. You&#8217;ll have access to this log file even if your container is removed.</p>
<h3 id="what-is-a-bind-mount">What is a bind mount?</h3>
<p>A bind mount is conceptually the same as a volume, however, instead of using a specific folder, you can mount any file or folder on the host. You&#8217;re also expecting the host can change the contents of these mounts. Just like volumes, the bind mount is created if you mount it, and it doesn&#8217;t yet exist on the host.</p>
<p>Bind mounts have limited functionality compared to volumes, and even though they&#8217;re more performant, they depend on the host having a specific folder structure in place.</p>
<p>Volumes are considered the preferred data storage strategy to use with containers.</p>
<h2 id="docker-container-network-configuration">Docker container network configuration</h2>
<p>The default Docker network configuration allows for the isolation of containers on the Docker host. This feature enables you to build and configure apps that can communicate securely with each other.</p>
<p>Docker provides three pre-configured network configurations:</p>
<ul>
<li>Bridge</li>
<li>Host</li>
<li>none</li>
</ul>
<p>You choose which of these network configurations to apply to your container depending on its network requirements.</p>
<h3 id="what-is-the-bridge-network">What is the bridge network?</h3>
<p>The bridge network is the default configuration applied to containers when launched without specifying any additional network configuration. This network is an internal, private network used by the container, and isolates the container network from the Docker host network.</p>
<p>Each container in the bridge network is assigned an IP address and subnet mask with the hostname defaulting to the container name. Containers connected to the default bridge network are allowed to access other bridge connected containers by IP address. The bridge network doesn&#8217;t allow communication between containers using hostnames.</p>
<p>By default, Docker doesn&#8217;t publish any container ports. To enable port mapping between the container ports and the Docker host ports, use the Docker port <code>--publish</code> flag.</p>
<p>The publish flag effectively configures a firewall rule that maps the ports.</p>
<p>In this example, your tracking portal is accessible to clients browsing to port 80. You&#8217;ll have to map port 80 from the container to an available port on the host. You have port 8080 open on the host, which enables you to set the flag like this.</p>
<div id="code-try-7" class="codeHeader" data-bi-name="code-header"><span class="language">Console</span></div>
<pre class="has-inner-focus" tabindex="0"><code class="lang-console" data-author-content="--publish 8080:80
">--publish 8080:80
</code></pre>
<p>Any client browsing to the Docker host IP and port 8080 can access the tracking portal.</p>
<h3 id="what-is-the-host-network">What is the host network?</h3>
<p>The host network enables you to run the container on the host network directly. This configuration effectively removes the isolation between the host and the container at a network level.</p>
<p>In this example, let&#8217;s assume you decide to change the networking configuration to the host network option. Your tracking portal is still accessible using the host IP. You can now use the well known port 80 instead of a mapped port.</p>
<p>Keep in mind that the container can use only ports not already used by the host.</p>
<h3 id="what-is-the-none-network">What is the none network?</h3>
<p>To disable networking for containers, use the none network option.</p>
<h3 id="operating-system-considerations">Operating system considerations</h3>
<p>Keep in mind that there are differences between desktop operating systems for the Docker network configuration options. For example, the <em>Docker0</em> network interface isn&#8217;t available on macOS when using the bridge network, and using the host network configuration isn&#8217;t supported for both Windows and macOS desktops.</p>
<p>These differences might affect the way your developers configure their workflow to manage container development.</p>
<p>The post <a href="http://kostacipo.stream/how-docker-containers-work/">How Docker containers work</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/how-docker-containers-work/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Containers vs Virtual Machines (VMs): What&#8217;s the Difference?</title>
		<link>http://kostacipo.stream/containers-vs-virtual-machines-vms-whats-the-difference/</link>
					<comments>http://kostacipo.stream/containers-vs-virtual-machines-vms-whats-the-difference/#respond</comments>
		
		<dc:creator><![CDATA[Majordomo]]></dc:creator>
		<pubDate>Mon, 20 Apr 2020 13:11:46 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[virtual machines]]></category>
		<guid isPermaLink="false">http://www.kostacipo.stream/?p=1786</guid>

					<description><![CDATA[<p>&#160; Both virtual machines and containers are used to created isolated virtual environments for developing and testing applications or software. The question is how they differ. This article examines the two concepts to help understand the difference between a container and a VM. It defines containers and virtual machines separately, as well as side-by-side, to [&#8230;]</p>
<p>The post <a href="http://kostacipo.stream/containers-vs-virtual-machines-vms-whats-the-difference/">Containers vs Virtual Machines (VMs): What&#8217;s the Difference?</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<div class="uncode_text_column">
<p>Both <strong>virtual machines</strong> and <strong>containers</strong> are used to created isolated virtual environments for developing and testing applications or software. The question is how they differ.</p>
<p>This article examines the two concepts to help understand the difference between a container and a VM. It defines containers and virtual machines separately, as well as side-by-side, to see what makes one distinct from the other.</p>
</div>
<div class="heading-text el-text">
<h2 class="h3"><span id="htoc-what-are-virtual-machines-vms">What are Virtual Machines (VMs)?</span></h2>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>A<strong> virtual machine (VM)</strong> is an operating system that shares the physical resources of one server. It is a guest on the host’s hardware, which is why it is also called a <strong>guest machine</strong>.</p>
<p>There are several layers that make up a virtual machine. The layer that enables virtualization is the <strong>hypervisor</strong>. A hypervisor is a software that virtualizes the server.</p>
</div>
<div class="heading-text el-text">
<h2 class="h3"><span id="htoc-how-a-virtual-machine-works">How a Virtual Machine Works</span></h2>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>Everything necessary to run an app is contained within the virtual machine – the virtualized hardware, an OS, and any required binaries and libraries. Therefore, virtual machines have their own infrastructure and are self-contained.</p>
<p><img decoding="async" class="aligncenter wp-image-84024 size-full lazyloaded" src="https://phoenixnap.com/kb/wp-content/uploads/2019/04/hypervisor-host-os-of-a-virtual-machine.png" alt="hypervisor host os of a virtual machine diagram " data-lazy-src="https://phoenixnap.com/kb/wp-content/uploads/2019/04/hypervisor-host-os-of-a-virtual-machine.png" data-was-processed="true" width="506" height="508"></p>
<p>Each VM is completely isolated from the host operating system. Also, it requires its own OS, which can be different from the host’s OS. Each has its own binaries, libraries, and applications.</p>
</div>
<div class="divider-wrapper ">
<hr class="border-accent-color separator-no-padding"></div>
<div class="icon-box icon-box-left">
<div class="icon-box-content">
<p><strong>Virtual machine monitor (VMM)</strong>: another name for the hypervisor</p>
<p><strong>Host machine</strong>: the hardware on which the VM is installed</p>
<p><strong>Guest&nbsp;</strong><strong>machine</strong>: another name for the VM</p>
</div>
</div>
<div class="divider-wrapper ">
<hr class="border-accent-color separator-no-padding">
<h3 class="h3"><span id="htoc-virtual-machine-pros">Virtual Machine: PROS</span></h3>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>VMs <strong>reduce expenses</strong>. Instead of running an application on a single server, a virtual machine enables utilizing one physical resource to do the job of many. Therefore, you do not have to buy, maintain and store enumerable stacks of servers.</p>
<p>Because there is one host machine, it allows you to <strong>efficiently manage</strong> all the virtual environments with the centralized power of the hypervisor. These systems are entirely separate from each other meaning you can install <strong>multiple system environments</strong>.</p>
<p>Most importantly, a virtual machine is isolated from the host OS and is a <strong>safe</strong> place for experimenting and developing applications.</p>
</div>
<div class="heading-text el-text">
<h3 class="h3"><span id="htoc-virtual-machine-cons">Virtual Machine: CONS</span></h3>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p><strong>Virtual machines may take up a lot of system resources&nbsp;</strong>of the host machine, being many GBs in size. Running a single app on a virtual server means running a copy of an operating system as well as a virtual copy of all the hardware required for the system to run. This quickly adds up to a lot of RAM and CPU cycles.</p>
<p>The process of&nbsp;<strong>relocating an app running on a virtual machine can also be complicated&nbsp;</strong>as it is always attached to the operating system. Hence, you have to migrate the app as well as the OS with it. Also, when creating a virtual machine, the hypervisor allocates hardware resources dedicated to the VM.</p>
<p>A virtual machine rarely uses all the resources available which can&nbsp;<strong>make the planning and distribution difficult.&nbsp;</strong>That’s still economical compared to running separate actual computers.</p>
</div>
<div class="heading-text el-text">
<h3 class="h3"><span id="htoc-popular-vm-providers">Popular VM providers:</span></h3>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<ul>
<li>VMware vSphere</li>
<li>VirtualBox</li>
<li>Zen</li>
<li>Hyper-V</li>
<li>KVM</li>
</ul>
<p>&nbsp;</p>
<h2><span id="htoc-what-is-a-container">What is a Container?</span></h2>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>A container is an environment that runs an application that is not dependent on the operating system. It isolates the app from the host by virtualizing it. This allows users to created multiple workloads on a single OS instance.</p>
<p>The kernel of the host operating system serves the needs of running different functions of an app, separated into containers. Each container runs isolated tasks. It cannot harm the host machine nor come in conflict with other apps running in separate containers.</p>
</div>
<div class="heading-text el-text">
<h2 class="h3"><span id="htoc-how-do-containers-work">How do Containers Work?</span></h2>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>When working inside a container, you can create a template of an environment you need. The container essentially runs a snapshot of the system at a particular time, providing consistency in the behavior of an app.</p>
<p>The container shares the host’s kernel to run all the individual apps within the container. The only elements that each container requires are bins, libraries and other runtime components.</p>
<p><img decoding="async" class="aligncenter wp-image-84025 size-full lazyloaded" src="https://phoenixnap.com/kb/wp-content/uploads/2019/04/container-elements.png" alt="container elements diagram" data-lazy-src="https://phoenixnap.com/kb/wp-content/uploads/2019/04/container-elements.png" data-was-processed="true" width="580" height="323"></p>
</div>
<div class="heading-text el-text">
<h3 class="h3"><span id="htoc-container-pros">Container: PROS</span></h3>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>Containers can be as small as 10MB. This makes containers remarkably <strong>lightweight</strong> and <strong>fast to launch</strong> as opposed to deploying virtual machines, where the entire operating system needs to be deployed.<br />Because of their size, you can quickly <strong>scale</strong> in and out of containers and add identical containers.</p>
<p>Also, containers are excellent for <strong>Continuous Integration and Continuous Deployment</strong> (CI/CD) implementation. They foster collaborative development by distributing and merging images among developers.</p>
</div>
<div class="heading-text el-text">
<h3 class="h3"><span id="htoc-container-cons">Container: CONS</span></h3>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>A container uses the kernel of the host OS and has operating system dependencies. Therefore, containers can differ from the underlying OS by dependency, but not by type. The host’s kernel <strong>limits the use of other operating systems</strong>.</p>
<p>Containers still do not offer the same <strong>security and stability</strong> that VMs can. Since they share the host’s kernel, they cannot be as isolated as a virtual machine. Consequently, containers are process-level isolated and one container can affect others by compromising the stability of the kernel.</p>
<p>Moreover, once a container performs its task, it shuts down, deleting all the data inside of it. If you want the data to remain on the host server, you have to save it using Data Volumes. This requires <strong>manual configuration and provisioning</strong> on the host.</p>
</div>
<div class="heading-text el-text">
<h3 class="h3"><span id="htoc-popular-container-providers">Popular Container Providers:</span></h3>
</div>
<div class="uncode_text_column">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul style="list-style-type: square;">
<li>Docker</li>
<li>AWS</li>
<li>LXD</li>
<li>Java Containers</li>
<li>Hyper-V Containers</li>
<li>Windows Server Containers</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="heading-text el-text">
<h2>&nbsp;</h2>
<h2 class="h3"><span id="htoc-how-to-choose-vms-vs-containers">How to Choose VMs vs Containers</span></h2>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>Deciding whether to go for virtual machines or containers depends on the work you want your virtual environment to carry out.</p>
</div>
<div class="heading-text el-text">
<h3 class="h3"><span id="htoc-how-to-choose-vms-vs-containers">Virtual machines&nbsp;are a better solution if you need to:</span></h3>
</div>
<div class="uncode_text_column">
<ol>
<li>Manage a variety of operating systems</li>
<li>Manage multiple apps on a single server</li>
<li>Run an app that requires all the resources and functionalities of an OS</li>
<li>Ensure full isolation and security</li>
</ol>
</div>
<div class="uncode_text_column">&nbsp;</div>
<div class="heading-text el-text">
<h3 class="h3"><span id="htoc-how-to-choose-vms-vs-containers">Containers are suitable if you need to:</span></h3>
</div>
<div class="uncode_text_column">
<ol>
<li>Maximize the number of apps running on a server</li>
<li>Deploy multiple instances of a single application</li>
<li>Have a lightweight system that quickly starts</li>
<li>Develop an application that runs on any underlying infrastructure</li>
</ol>
</div>
<div class="divider-wrapper ">
<hr class="border-accent-color separator-no-padding"></div>
<div class="icon-box icon-box-left">
<div class="icon-box-icon fa-container">&nbsp;</div>
<div class="icon-box-content">
<p><strong>Note:&nbsp;</strong>VMs and containers should not necessarily be seen as rivals. Rather, you can use both to balance the workload between the two.</p>
</div>
</div>
<div class="divider-wrapper ">
<hr class="border-accent-color separator-no-padding"></div>
<div class="uncode_text_column">
<p><strong>Virtual machines are commonly used for&nbsp;</strong>demanding applications, network infrastructure, and apps that will consume most of the resources of the VM.</p>
</div>
<div class="uncode_text_column">
<p><strong>Containers are commonly used for&nbsp;</strong>web, applications and caching services, network daemons, and small databases.</p>
</div>
<div class="heading-text el-text">
<h3 class="h3"><span id="htoc-drawbacks-of-containers">Conclusion</span></h3>
</div>
<div class="clear">&nbsp;</div>
<div class="uncode_text_column">
<p>Before committing to VMs or containers, make sure to consider all the factors that will influence efficiency. Take into account the kind of tasks they will have to perform as well as the resources you have available.</p>
</div>
<p>The post <a href="http://kostacipo.stream/containers-vs-virtual-machines-vms-whats-the-difference/">Containers vs Virtual Machines (VMs): What&#8217;s the Difference?</a> appeared first on <a href="http://kostacipo.stream">Tech Chronicles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kostacipo.stream/containers-vs-virtual-machines-vms-whats-the-difference/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
