<p>
Docker is used to run isolated Linux system environments on a single host.<br />
The idea is based on Linux Containers (LXC).
</p>

<h3>Contents</h3>
<ul>
<li><a href="#install">Installation</a></li>
<li><a href="#images">Images</a>
<ul>
<li><a href="#images_create">Create an image</a></li>
</ul>
</li>
<li><a href="#containers">Containers</a></li>
<li><a href="#links">External Links</a></li>
</ul>

<h3 id="install">Installation</h3>
<p>
The official Debian repository contains Docker:
</p>
<pre><code class="language-bash">sudo apt install docker.io</code></pre>
<p>
Enable the user <code>johndoe</code> to use Docker by adding the user to the group <code>docker</code>:
</p>
<pre><code class="language-bash">sudo usermod -a -G docker johndoe</code></pre>

<h3 id="images">Images</h3>
<p>
Docker Hub provides images of various Linux distributions.<br />
To download the official docker image <code>debian</code>, run the following command:
</p>
<pre><code class="language-bash">docker pull debian:latest</code></pre>
<p>
List local images:
</p>
<pre><code class="language-bash">docker image ls</code></pre>
<h4 id="images_create">Create an image</h4>
<dl class="file">
<dt><code class="filename">Dockerfile</code></dt>
<dd>
<pre class="file"><code class="language-dockerfile">FROM debian:11
RUN apt-get update && apt-get -y install build-essential
</code></pre>
</dd>
</dl>
<pre><code class="language-bash">docker build --tag=my-build-env .</code></pre>

<h3 id="containers">Containers</h3>
<p>
An instance of an image is called container.<br />
To start a container using the image <code>debian</code> with an interactive terminal:
</p>
<pre><code class="language-bash">docker run -it --network=none --volume=/home/johndoe/shared:/mnt/shared debian</code></pre>
<p>
List running containers:
</p>
<pre><code class="language-bash">docker container ls</code></pre>

<h3 id="links">External Links</h3>
<ul>
<li><a href="https://www.docker.com/" target="_blank">
https://www.docker.com/</a></li>
<li><a href="https://hub.docker.com/search?image_filter=official&type=image" target="_blank">
https://hub.docker.com/search?image_filter=official&type=image</a></li>
</ul>