<?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[Liza Learns Cloud]]></title><description><![CDATA[Liza Learns Cloud]]></description><link>https://lizanduruhu.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 30 Nov 2026 01:33:57 GMT</lastBuildDate><atom:link href="https://lizanduruhu.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Day 2 of 7 Days of Docker: I Built My Own Whale 🐳]]></title><description><![CDATA[Building my first custom Docker image: a Dockerfile, Apache, port mapping, and what happens when you change your HTML. Day 2 of 7! 🐳]]></description><link>https://lizanduruhu.hashnode.dev/day-2-7-days-of-docker</link><guid isPermaLink="true">https://lizanduruhu.hashnode.dev/day-2-7-days-of-docker</guid><category><![CDATA[Docker]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Devops]]></category><category><![CDATA[beginner]]></category><dc:creator><![CDATA[Liza Nduruhu]]></dc:creator><pubDate>Sun, 29 Nov 2026 05:07:42 GMT</pubDate><content:encoded><![CDATA[<p>Yesterday I ran someone else's container. Today I built my own. 🐳</p>
<p>My mission: package a simple webpage into my own Docker image, run it, and open it in my browser.</p>
<h2>Image vs Container (quick recap)</h2>
<p>An image is the frozen recipe. A container is the live thing running from it. Today, liza-whale was my image and liza-site was my website running from it.</p>
<h2>What is a Dockerfile?</h2>
<p>A Dockerfile is the recipe card. It's a simple text file that tells Docker, step by step, how to build an image. Without it, Docker has no idea which base to start from or which files to add, so it can't build anything.</p>
<p>Mine was just two lines:</p>
<pre><code class="language-plaintext">FROM httpd:2.4
COPY index.html /usr/local/apache2/htdocs/index.html
</code></pre>
<ul>
<li><strong>FROM</strong> = "start from the official Apache web server image." I didn't build a web server from scratch. I built <em>on top of</em> one.</li>
<li><strong>COPY</strong> = "put my webpage inside the image."</li>
<li>Why <strong>/usr/local/apache2/htdocs</strong>? That's the folder the official Apache image serves websites from, so my page has to live there.</li>
</ul>
<h2>What I did</h2>
<h3>1. Created my project</h3>
<p>A folder called <code>Day2</code>, an <code>index.html</code> with my name, a welcome heading and some emojis, and my <code>Dockerfile</code>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/37ff3fc7-34e4-4a6c-a45d-9fdc3aad9561.png" alt="" style="display:block;margin:0 auto" />

<p>2. Built my image</p>
<pre><code class="language-plaintext">docker build -t liza-whale .
</code></pre>
<p>Each Dockerfile line became a step: <strong>[1/2] FROM</strong> downloaded Apache, and <strong>[2/2] COPY</strong> added my page on top.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/351756d5-c15a-46c4-a6a7-f65bcbe9f6e0.png" alt="" style="display:block;margin:0 auto" />

<h3>3. Ran it</h3>
<pre><code class="language-plaintext">docker run -d -p 8080:80 --name liza-site liza-whale
</code></pre>
<p>The part that clicked for me: <code>-p 8080:80</code>. Apache listens on port 80 <em>inside</em> the sealed container. Port mapping opens port 8080 on my laptop and forwards it inside.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/526d7326-3fa7-4267-a430-bbaa4e362722.png" alt="" style="display:block;margin:0 auto" />

<h3>4. Opened localhost:8080</h3>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/9b3cea26-9247-41a5-a543-51ada7ce7f88.png" alt="" style="display:block;margin:0 auto" />

<p>Seeing my own name served from a container I built was such a good feeling.</p>
<h3>5. Proved everything</h3>
<ul>
<li><code>docker ps</code>: container running ✅</li>
<li><code>docker port liza-site</code>: 80 → 8080 ✅</li>
<li><code>docker exec liza-site cat /usr/local/apache2/htdocs/index.html</code>: my HTML is really inside the container ✅</li>
</ul>
<h2>The experiment: what if I change my HTML? 🤔</h2>
<ol>
<li>Edited <code>index.html</code> and refreshed: <strong>no change.</strong></li>
<li>Rebuilt the image and refreshed: <strong>still no change!</strong> The running container was made from the <em>old</em> image.</li>
<li>Stopped it, removed it, ran a new one: <strong>"Day 2 update: I changed this page!"</strong></li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/d484d33b-a269-41a3-86dc-f9d49683d68b.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Lesson:</strong> an image is a snapshot. To change what's running: rebuild the image, then replace the container.</p>
<h2>What tripped me up 😅</h2>
<ul>
<li><strong>A typo that failed silently.</strong> I typed "webiste" in my <code>sed</code> command. No error, but nothing changed either. <strong>No error doesn't always mean it worked.</strong></li>
<li><strong>Forgetting the</strong> <code>.</code> in <code>docker build</code>. That dot tells Docker which folder to build from.</li>
</ul>
<h2>Cleanup</h2>
<p>Stopped and removed the container, removed the image, verified everything was empty. No zombies left.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/b5309e12-a930-4ac0-a32f-c037e90e1990.png" alt="" style="display:block;margin:0 auto" />

<p>Two days ago I didn't know what a container was. Today I built one. 🐳 <strong>Next up, Day 3: volumes and live website editing.</strong></p>
<p>#7DaysOfDocker #AWSreStart #Docker #DevOps #LearningInPublic</p>
]]></content:encoded></item><item><title><![CDATA[Day 1 of 7 Days of Docker: I Went From "What's a Container?" to Running My Own 🐳]]></title><description><![CDATA[AWS re/Start grad learning Docker from zero: installing it on WSL, running my first containers, and cleaning up like a pro. Day 1 of 7! 🐳]]></description><link>https://lizanduruhu.hashnode.dev/day-1-7-days-of-docker</link><guid isPermaLink="true">https://lizanduruhu.hashnode.dev/day-1-7-days-of-docker</guid><category><![CDATA[Docker]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[AWS]]></category><dc:creator><![CDATA[Liza Nduruhu]]></dc:creator><pubDate>Sat, 28 Nov 2026 20:25:21 GMT</pubDate><content:encoded><![CDATA[<p>Hi, I'm Liza. I recently graduated from AWS re/Start (Cohort 15), I work as a social media manager, and I create content. This week I'm taking on the <strong>7 Days of Docker Challenge</strong>, and I'm documenting every day, including the parts where I got lost.</p>
<p>Before today, I had never touched Docker. I didn't even have Linux on my laptop. Here's what I learned on Day 1.</p>
<h2>So… what is Docker?</h2>
<p>Think of Docker as a way to pack an app into a box together with everything it needs to run: the code, the tools, the libraries, the settings. That box is called a container, and it runs the same way on any computer that has Docker.</p>
<h2>What problem does it solve?</h2>
<p>You know the classic developer excuse: <em>"But it works on my machine!"</em> 😅</p>
<p>An app runs perfectly on one laptop, then breaks on another computer or a server because a version is different or a setting is missing. Docker fixes this by shipping the whole environment together with the app. If it works in the container on my laptop, it works in the container everywhere.</p>
<p>It also saves time. Instead of spending hours installing things, you run one command and you're ready.</p>
<h2>Image vs Container: the Canva way</h2>
<p>This one clicked for me because of my social media work:</p>
<ul>
<li>An image is like a Canva template. It's the frozen design you start from, and you don't edit the template itself.</li>
<li>A container is like an actual post you create from that template. It's live and in use, and you can make as many posts as you want from one template.</li>
</ul>
<p>So: image = the blueprint, container = the running thing made from it. One image can create many containers.</p>
<h2>Why "containerization" and not "virtualization"?</h2>
<p>A virtual machine (VM) pretends to be a whole separate computer, with its own full operating system. That makes it heavy: gigabytes in size and minutes to start.</p>
<p>A container doesn't bring its own full operating system. It shares the host computer's Linux kernel (the core of the OS) and only isolates the app and what it needs. That makes it light: megabytes in size and seconds to start.</p>
<p>My analogy: VMs are separate houses, each with its own plumbing and electricity. Containers are apartments in one building. They share the plumbing, but each has its own locked door.</p>
<p>I saw this for myself today: the Ubuntu image I downloaded was about 45 MB to download. A full Ubuntu VM would be several gigabytes.</p>
<h2>Where do Docker images come from?</h2>
<p>Images live in a registry, which is basically an online library of images. The default one is Docker Hub. Others include Amazon ECR (AWS's registry, hello Cloud Practitioner exam 👀) and GitHub Container Registry.</p>
<p>When you ask Docker to run an image you don't have, it pulls (downloads) it from the registry first.</p>
<h2>What I actually did</h2>
<h3>Step 1: Getting a Linux machine</h3>
<p>The challenge needs Linux, and I'm on Windows. My laptop already had WSL2 (Windows Subsystem for Linux) turned on but no Linux installed, so I installed Ubuntu with:</p>
<pre><code class="language-plaintext">wsl --install -d Ubuntu
</code></pre>
<h3>Step 2: Installing Docker (the official way)</h3>
<p>Following Docker's official Ubuntu installation docs (<a href="http://docs.docker.com/engine/install/ubuntu">docs.docker.com/engine/install/ubuntu</a>), I used their convenience script:</p>
<pre><code class="language-plaintext">curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
</code></pre>
<p>Then I added my user to the <code>docker</code> group so I don't need <code>sudo</code> for every command:</p>
<pre><code class="language-plaintext">sudo usermod -aG docker $USER
</code></pre>
<p>After restarting Ubuntu, I checked the version:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/229f6c4f-e2fc-4522-b9fd-da48246d6f8b.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Docker version 29.10.1</strong></p>
<h3>Step 3: Is Docker alive?</h3>
<p>Docker works as a client and a server. The <code>docker</code> command I type is the client, and it sends instructions to the Docker daemon (<code>dockerd</code>), a background service that does the real work.</p>
<p>To check the daemon was running:</p>
<pre><code class="language-plaintext">sudo systemctl status docker
</code></pre>
<p>I got <code>active (running)</code> in green, and it's enabled, so it starts automatically.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/bb9d54ed-fa34-4d64-9c15-cb86fec3ee84.png" alt="" style="display:block;margin:0 auto" />

<p>Then I ran <code>docker info</code> for a full health report. If the daemon were broken, I'd have got a <em>"Cannot connect to the Docker daemon"</em> error. Instead it answered with Containers: 0, Images: 0: healthy, and a clean slate.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/4c4c4d30-897e-46aa-aed7-ab0eca9131b7.png" alt="" style="display:block;margin:0 auto" />

<h3>Step 4: My first container!</h3>
<pre><code class="language-plaintext">docker run hello-world
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/f930b3c8-9dcd-499f-9c21-7171216019c0.png" alt="" style="display:block;margin:0 auto" />

<p>Did Docker already have the image? No! The first line said <em>"Unable to find image 'hello-world:latest' locally"</em>, so Docker pulled it from Docker Hub, created a container from it, and printed the message.</p>
<p>Then I went inside a container:</p>
<pre><code class="language-plaintext">docker run -it ubuntu bash
</code></pre>
<p>My prompt changed to <code>root@78e8bb8254d8:/#</code>. I was inside a separate, tiny Ubuntu, and <code>78e8bb8254d8</code> was the container's ID. Running <code>cat /etc/os-release</code> showed Ubuntu 26.04.1 LTS. When I typed <code>exit</code>, the container stopped, because a container only lives as long as its main program.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/acfcc81c-d694-4254-9116-4e312f208da6.png" alt="" style="display:block;margin:0 auto" />

<h3>Step 5: Investigating my environment</h3>
<pre><code class="language-plaintext">docker images              # which images exist
docker ps                  # which containers are running
docker ps -a               # all containers, running AND stopped
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/e9123127-7f2a-4ddc-bb4f-116235d993b8.png" alt="" style="display:block;margin:0 auto" />

<p>What I found:</p>
<ul>
<li><strong>2 images:</strong> <code>hello-world</code> and <code>ubuntu</code></li>
<li><strong>0 running containers</strong></li>
<li><strong>2 stopped containers</strong>, both with status <code>Exited (0)</code>. The <code>0</code> means they finished successfully.</li>
<li>Docker gave them random names: <code>friendly_driscoll</code> and <code>nice_euclid</code> 😄</li>
</ul>
<h3>Step 6: Leave no zombies 🧟</h3>
<p>Stopped containers and unused images quietly eat disk space, and on a cloud server, storage costs money. So I cleaned up:</p>
<pre><code class="language-plaintext">docker container prune     # remove stopped containers
docker image prune -a      # remove unused images
</code></pre>
<p>Order matters! Docker won't delete an image that a container is still using, so containers go first, then images.</p>
<p>I reclaimed 162.8 MB, and both lists came back empty.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b0b2fc7db9e1d2738954ebc/0ff498a7-cd6e-4417-8388-f748a341c173.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>What broke (and what I learned from it) 🤦🏽‍♀️</h2>
<p>Because I launched Ubuntu from PowerShell, it opened inside my Windows system folder instead of my Linux home folder. I only noticed when <code>ls</code> printed a huge list of files. I fixed it with:</p>
<pre><code class="language-plaintext">pwd     # where am I?
cd ~    # go to my home folder
</code></pre>
<p><strong>Lesson:</strong> always know where you are in the terminal.</p>
<h2>My biggest takeaways</h2>
<ol>
<li>Image = template, container = the live thing made from it.</li>
<li>Containers are light because they share the host's kernel instead of running a full OS.</li>
<li>Docker is a client talking to a daemon. If the daemon is down, nothing works.</li>
<li>Clean up after yourself: containers first, then images.</li>
</ol>
<p>Fulfilled, a little sleepy, and very proud. 😴🐳 Day 1 came in late, but I finished it, understood every command I ran, and actually enjoyed the errors. Turns out the whale is friendlier than I thought. On to Day 2!</p>
<h2>Next up: Day 2 🐳</h2>
<p>Building my own custom image with a Dockerfile. Follow along!</p>
<p>#7DaysOfDocker #AWSreStart #Docker #DevOps #LearningInPublic</p>
]]></content:encoded></item></channel></rss>