<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Docker on Nerdsid.com</title><link>https://nerdsid.com/tags/docker/</link><description>Recent content in Docker on Nerdsid.com</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 01 Jul 2026 13:30:50 +0000</lastBuildDate><atom:link href="https://nerdsid.com/tags/docker/index.xml" rel="self" type="application/rss+xml"/><item><title>Container Cpu Limit Configuration</title><link>https://nerdsid.com/posts/docker-container-cpu-limits/</link><pubDate>Wed, 01 Jul 2026 13:30:50 +0000</pubDate><guid>https://nerdsid.com/posts/docker-container-cpu-limits/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>In this lab, you&amp;rsquo;ll limit the CPU usage of a Docker container that consumes excessive CPU resources.&lt;/p>
&lt;h2 id="scenario">Scenario&lt;/h2>
&lt;p>A container named &lt;code>cpu_test&lt;/code> is running from the &lt;code>myapp:cpu&lt;/code> image and performs CPU-intensive computations. When monitored with &lt;code>docker stats&lt;/code>, the container regularly consumes 150–200% CPU, utilizing multiple CPU cores and impacting other services on the host.&lt;/p>
&lt;h2 id="task">Task&lt;/h2>
&lt;p>Recreate the container with a CPU limit of 500m CPU so that &lt;code>docker stats&lt;/code> reports CPU usage consistently below 60% during validation.&lt;/p></description></item><item><title>Docker Compose Basic</title><link>https://nerdsid.com/posts/docker-compose-basic/</link><pubDate>Wed, 01 Jul 2026 11:38:29 +0000</pubDate><guid>https://nerdsid.com/posts/docker-compose-basic/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>In this lab, you&amp;rsquo;ll first deploy an application by setting up network, multiple containers individually. Then you will clean up resources, and deploy the same application using Docker Compose.&lt;/p>
&lt;h2 id="task-1-create-a-bridge-network">Task 1: Create a Bridge Network&lt;/h2>
&lt;p>Create a bridge network named &lt;code>clicknet&lt;/code>.&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">docker network create --driver bridge clicknet&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h3 id="verify">Verify&lt;/h3>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">list docker networks&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>$ docker network ls
NETWORK ID NAME DRIVER SCOPE
5aa54ade2dcc bridge bridge local
fc40bfcbce91 clicknet bridge local
238b23f4e2a9 host host local
59b9cbf97489 none null local&lt;/code>&lt;/pre>
&lt;/figure>

&lt;h2 id="task-2-run-a-redis-container">Task 2: Run a Redis Container&lt;/h2>
&lt;p>Create a background container named &lt;code>redis&lt;/code> using the &lt;code>redis:alpine&lt;/code> image and attach it to the &lt;code>clicknet&lt;/code> network.&lt;/p></description></item><item><title>Docker Environment Variables and Networking</title><link>https://nerdsid.com/posts/docker-environment-variables-and-networking/</link><pubDate>Tue, 16 Jun 2026 06:50:38 +0000</pubDate><guid>https://nerdsid.com/posts/docker-environment-variables-and-networking/</guid><description>&lt;p>In this lab, we&amp;rsquo;ll explore:&lt;/p>
&lt;ul>
&lt;li>Inspecting environment variables in running containers&lt;/li>
&lt;li>Passing environment variables at runtime&lt;/li>
&lt;li>Deploying MySQL containers&lt;/li>
&lt;li>Creating custom Docker networks&lt;/li>
&lt;li>Connecting applications and databases across containers&lt;/li>
&lt;/ul>
&lt;h2 id="task-1-inspect-environment-variables">Task 1: Inspect Environment Variables&lt;/h2>
&lt;p>First, identify the value configured for the &lt;code>APP_COLOR&lt;/code> environment variable in a running container.&lt;/p>
&lt;p>List the running containers:&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;/header>
 &lt;pre>&lt;code>$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cdf886f902d4 kodekloud/simple-webapp "python app.py" 10 minutes ago Up 10 minutes 8080/tcp mystifying_knuth&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>Inspect the container and look for the &lt;code>Env&lt;/code> section:&lt;/p></description></item><item><title>Docker Basic Commands</title><link>https://nerdsid.com/posts/docker-basic-commands/</link><pubDate>Mon, 01 Jun 2026 12:33:56 +0000</pubDate><guid>https://nerdsid.com/posts/docker-basic-commands/</guid><description>&lt;h2 id="task-1">Task 1&lt;/h2>
&lt;p>What is the version of the Docker Server Engine running on the host?&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">Check Docker version&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>$ docker version

Client:
Version: 25.0.5
API version: 1.44

Server:
Engine:
Version: 25.0.5
API version: 1.44&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>&lt;strong>Answer:&lt;/strong> &lt;code>25.0.5&lt;/code>&lt;/p>
&lt;h2 id="task-2">Task 2&lt;/h2>
&lt;p>How many containers are currently running on this host?&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">List running containers&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>&lt;strong>Answer:&lt;/strong> &lt;code>0&lt;/code>&lt;/p>
&lt;h2 id="task-3">Task 3&lt;/h2>
&lt;p>How many images are available on this host?&lt;/p></description></item><item><title>Publishing Ports in Docker</title><link>https://nerdsid.com/posts/publishing-ports-in-docker/</link><pubDate>Fri, 01 May 2026 14:37:01 +0000</pubDate><guid>https://nerdsid.com/posts/publishing-ports-in-docker/</guid><description>&lt;h2 id="task">Task&lt;/h2>
&lt;h2 id="solution">Solution&lt;/h2>

&lt;details
>
&lt;summary onclick="this.innerHTML = this.parentNode.open ? 'Show solution' : 'Show solution';">
 
 Show solution
 
&lt;/summary>
 &lt;p>This is the first paragraph of detailed content.
This is the second paragraph of even more detailed content.&lt;/p>
&lt;ul>
&lt;li>You can also include lists&lt;/li>
&lt;li>Or other markdown elements&lt;/li>
&lt;/ul>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename">
 
 service/networking/network-policy-default-deny-egress.yaml
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nn">---&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">networking.k8s.io/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">NetworkPolicy&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">default-deny-ingress&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">podSelector&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{}&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">policyTypes&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">Ingress&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>





&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">ls -R /etc/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">grep &lt;span class="s2">&amp;#34;name&amp;#34;&lt;/span> file.txt&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>





&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 PYTHON
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;God&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">greeting&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;Hello &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">name&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">greeting&lt;/span>&lt;span class="p">)&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h3 id="terminal-output">Terminal output&lt;/h3>
&lt;p>Before&lt;/p></description></item><item><title>Docker failed to resolve</title><link>https://nerdsid.com/posts/docker-failed-to-resolve-metadata/</link><pubDate>Tue, 31 Mar 2026 05:27:57 +0000</pubDate><guid>https://nerdsid.com/posts/docker-failed-to-resolve-metadata/</guid><description>&lt;p>I recently enountered this error.&lt;/p></description></item></channel></rss>