<commit_before><?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[<NAME>]]></title><description><![CDATA[Notepad of a Software Engineer]]></description><link>https://PierreBtz.github.io</link><generator>RSS for Node</generator><lastBuildDate>Sun, 04 Dec 2016 17:43:48 GMT</lastBuildDate><atom:link href="https://PierreBtz.github.io/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Docker starter kit part 2: Anatomy of an Image and a Container]]></title><description><![CDATA[<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>In the <a href="https://pierrebtz.github.io/2016/11/27/Docker-starter-kit-part-1-Getting-Started-Containers-lifecycle.html">first part</a> of this blog series on Docker, you had the opportunity to follow a Docker basic tutorial and to have an overview of the lifecycle of a Docker container.</p>
</div>
<div class="paragraph">
<p>In this post, we will have an overview on what a Docker Image and a Docker Container are made up.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_anatomy_of_an_image">Anatomy of an image</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_union_file_systems">Union File Systems</h3>
<div class="quoteblock">
<blockquote>
Union file systems, or UnionFS, are file systems that operate by creating layers, making them very lightweight and fast. Docker uses union file systems to provide the building blocks for containers.
</blockquote>
<div class="attribution">
&#8212; Docker Official Documentation
</div>
</div>
<div class="paragraph">
<p>We will see next how those UnionFS are exploited in Docker.</p>
</div>
</div>
<div class="sect2">
<h3 id="_unionfs_and_docker_images">UnionFS and Docker Images</h3>
<div class="paragraph">
<p>A Docker image is made of several layers.
Each layer represents a filesystem difference with the layer below it.
The stack of all the layers makes up the filesystem of an image.
Each layer is <strong>read only</strong> and shared between the images (and the containers, as we will see in the next part).</p>
</div>
<div class="paragraph">
<p>As you may have guessed, all of this means that you need to be very careful when building new image to maximize the reuse of layers.
We will discuss this in details in another blog post of this series.</p>
</div>
</div>
<div class="sect2">
<h3 id="_hands_on">Hands On!</h3>
<div class="paragraph">
<p>Let us take a concrete example.
Let us pull a maven image:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">docker pull maven:3.3.9-jdk-8</code></pre>
</div>
</div>
<div class="paragraph">
<p>Do not bother with the output of the command yet, we will get back to it later.
Instead, let&#8217;s now use the history commands that displays all the layers of an image:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">docker history maven:3.3.9-jdk-8</code></pre>
</div>
</div>
<div class="paragraph">
<p>And the output:</p><commit_msg>Publish rss feed<commit_after><?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[<NAME>]]></title><description><![CDATA[Notepad of a Software Engineer]]></description><link>https://PierreBtz.github.io</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Dec 2016 09:25:29 GMT</lastBuildDate><atom:link href="https://PierreBtz.github.io/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Docker starter kit part 2: Anatomy of an Image and a Container]]></title><description><![CDATA[<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>In the <a href="https://pierrebtz.github.io/2016/11/27/Docker-starter-kit-part-1-Getting-Started-Containers-lifecycle.html">first part</a> of this blog series on Docker, you had the opportunity to follow a Docker basic tutorial and to have an overview of the lifecycle of a Docker container.</p>
</div>
<div class="paragraph">
<p>In this post, we will have an overview on what a Docker Image and a Docker Container are made up.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_anatomy_of_an_image">Anatomy of an image</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_union_file_systems">Union File Systems</h3>
<div class="quoteblock">
<blockquote>
Union file systems, or UnionFS, are file systems that operate by creating layers, making them very lightweight and fast. Docker uses union file systems to provide the building blocks for containers.
</blockquote>
<div class="attribution">
&#8212; Docker Official Documentation
</div>
</div>
<div class="paragraph">
<p>We will see next how those UnionFS are exploited in Docker.</p>
</div>
</div>
<div class="sect2">
<h3 id="_unionfs_and_docker_images">UnionFS and Docker Images</h3>
<div class="paragraph">
<p>A Docker image is made of several layers.
Each layer represents a filesystem difference with the layer below it.
The stack of all the layers makes up the filesystem of an image.
Each layer is <strong>read only</strong> and shared between the images (and the containers, as we will see in the next part).</p>
</div>
<div class="paragraph">
<p>As you may have guessed, all of this means that you need to be very careful when building new images to maximize the reuse of layers.
We will discuss this in details in another blog post of this series.</p>
</div>
</div>
<div class="sect2">
<h3 id="_hands_on">Hands On!</h3>
<div class="paragraph">
<p>Let us take a concrete example.
Let us pull a maven image:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">docker pull maven:3.3.9-jdk-8</code></pre>
</div>
</div>
<div class="paragraph">
<p>Do not bother with the output of the command yet, we will get back to it later.
Instead, let&#8217;s now use the history commands that displays all the layers of an image:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">docker history maven:3.3.9-jdk-8</code></pre>
</div>
</div>
<div class="paragraph">
<p>And the output:</p>
{'fraction_non_alphanumeric': 0.15573267933782955, 'fraction_numerical': 0.02023298589822195, 'mean_word_length': 5.761658031088083, 'pattern_counts': {'":': 0, '<': 205, '<?xml version=': 2, '>': 203, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1145164', 'n_tokens_mistral': 2180, 'n_tokens_neox': 2041, 'n_words': 719}