<?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[BoomG-Tech blog]]></title><description><![CDATA[BoomG-Tech blog]]></description><link>https://blog.boomgtech.com</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 08:09:04 GMT</lastBuildDate><atom:link href="https://blog.boomgtech.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Getting Started With Docker 2023]]></title><description><![CDATA[Hey, have you heard of docker? If you haven't, then let me tell you that it's an amazing tool that you should definitely add to your list of tools. But if you're a software developer, you've probably heard about it, either in some forums or in discus...]]></description><link>https://blog.boomgtech.com/getting-started-with-docker-2023</link><guid isPermaLink="true">https://blog.boomgtech.com/getting-started-with-docker-2023</guid><category><![CDATA[Docker]]></category><category><![CDATA[containers]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Georges Fouejio]]></dc:creator><pubDate>Fri, 03 Feb 2023 21:13:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1675091100093/bfb487fa-3ee3-4f95-8f76-69d082a17329.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey, have you heard of <strong>docker</strong>? If you haven't, then let me tell you that it's an amazing tool that you should definitely add to your list of tools. But if you're a software developer, you've probably heard about it, either in some forums or in discussions between friends.</p>
<p>In this article, I explain what <strong>docker</strong> is and I show you how to create your first docker image and launch your first container.</p>
<h3 id="heading-what-is-docker">What is Docker?</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675448578639/ea81a3d6-2e6f-4a66-89cb-26c77e5dca9b.png" alt class="image--center mx-auto" /></p>
<p>Docker is a tool to create <strong>application containers</strong>. That's it! You were expecting something complicated? Well, no. Now I want you to repeat it with me: <strong>Docker is a tool to create application containers</strong>. Now that this is said, let's see what an application container is.</p>
<h3 id="heading-application-container"><strong>Application container</strong></h3>
<p><strong>An application container is an isolated framework where an application executes (or several but in the majority of cases, it is one application for one container)</strong>. A container has the advantage of being lighter and runs on a host system, unlike a virtual machine which requires more resources.</p>
<h3 id="heading-containerization-vs-virtualization"><strong>Containerization Vs Virtualization</strong></h3>
<p>Docker works with a <strong>Conteuneurization</strong> system and not with <strong>Virtualization</strong>.</p>
<p><strong>Virtualization</strong> allows the mobilization of the resources of a host system to create another virtual system. For example, I am on a <strong>windows</strong> machine and I need to test a <strong>Linux</strong> system but I don't want to install it in another partition of my hard disk. Then I can use virtualization with a tool like <strong>VirtualBox</strong> or <strong>VMWare</strong> to allocate resources for the virtual system. Here are virtualized processor, the RAM, the hard disk, the network, etc., which mobilizes a significant amount of resources. Isn't it?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675456752865/5c157f1b-a4b3-43e5-9582-f2013ecb1f86.png" alt class="image--center mx-auto" /></p>
<p><strong>Conteuneurization</strong>, unlike virtualization, does not run an entire system, but rather it runs an application in its context, which mobilizes just a few resources because the application here only works with what it needs.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675456637519/1aeaa5d8-ee08-4e64-b25d-bcb0e84ddec4.png" alt class="image--center mx-auto" /></p>
<p>Now that we know a little more about containerization and virtualization, let's describe a situation where docker will be useful.</p>
<h3 id="heading-the-problem">The problem</h3>
<p>I cloned a project that consists of a j<strong>ava spring-boot server</strong>, a <strong>nodeJs server</strong>, a <strong>Postgres database</strong>, a <strong>Redis database</strong>, and a <strong>React frontend</strong>; and my boss told me: Come on, run this project, my seasoned developer.</p>
<p>Here it becomes a bit complicated because you have to install <strong>java</strong>, <strong>nodeJs</strong>, <strong>redis</strong>, and the versions to install must correspond to the needs of each. Let's say you are a good developer, you install everything and it works. Now you are asked to deploy all this in a VPS. You still have to install and configure everything in the VPS, maintain the versions, etc. And if you are in a team that some use <strong>Linux</strong>, some use <strong>windows</strong>, some use <strong>MacOs,</strong> and some use <strong>Centos</strong>, maintaining that can become difficult in the long run. You see where I'm going with this, don't you?</p>
<p>That's where <strong>Docker application management</strong> comes in.</p>
<h3 id="heading-thanks-docker">Thanks, Docker</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675456892557/4b24efd9-e3bb-4351-bb5e-0ddd6e6af83f.png" alt class="image--center mx-auto" /></p>
<p>Thanks to docker, because being on different OS (Mac, Windows, Linux, centos), we can have the same functioning using containerization. For our problem, we could have:</p>
<ul>
<li><p><strong>an image for java</strong> that we will use to launch a container in which our java spring-boot server will run</p>
</li>
<li><p><strong>an image for nodeJs</strong> thanks to which we will launch a container in which our nodeJs server will run</p>
</li>
<li><p><strong>an image for postgres</strong> thanks to which we will launch a container in which our relational database server PostgreSQL will run</p>
</li>
<li><p><strong>an image for Redis</strong> thanks to which we will launch a container in which our Redis server will run</p>
</li>
<li><p>and finally <strong>an image for our React frontend app</strong> thanks to which we will launch a container in which our frontend app will run</p>
</li>
</ul>
<p>The big advantage is that these images work everywhere and exactly the same way whatever the operating system, as long as it can run docker, and luckily for us, docker is available on the majority of Os that we use daily, whether Linux, macOS, or Windows.</p>
<h3 id="heading-images-amp-containers">Images &amp; Containers</h3>
<p>These are <strong><em>the two fundamental components of docker</em></strong>. If we have to remember anything, it is this. We will quickly explain these two concepts in the context of docker and then we will move on to the installation of docker.</p>
<h3 id="heading-docker-container">Docker Container</h3>
<p>In Docker, a container is an isolated environment on which an application usually runs. This environment has a file system and contains the bare necessities for its operation. A container is launched from a <strong><em>docker image</em></strong>. To know more about it, check the official docker documentation about docker containers [link].</p>
<h3 id="heading-docker-image">Docker Image</h3>
<p>In docker, an image is a set of configurations that allows launching a container. An image contains everything needed to launch an application. A docker image can therefore be used to launch several instances of containers that will work exactly the same way. To learn more, check the official docker documentation about docker images.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675458113321/a7f60694-fd25-431e-845f-5f8c5fdd6dad.webp" alt class="image--center mx-auto" /></p>
<p>There are two types of docker images:</p>
<ul>
<li><p><strong>Public docker images,</strong> which are available on the <strong><em>docker hub</em></strong>. public images can be pulled and used by everyone</p>
</li>
<li><p><strong>Private docker images</strong> are those that we build ourselves and are not available to the general public.</p>
</li>
</ul>
<p><strong>PS:</strong> it is to be noted that an image can be created from another image, which makes it possible to start on something and not to remake the wheel each time. Isn't docker magic?</p>
<h3 id="heading-docker-installation">Docker installation</h3>
<p>Installing docker is quite simple, whether you are on mac, windows or Linux. <a target="_blank" href="https://docs.docker.com/">The official doc</a> provides all steps to follow.</p>
<p>For <strong>macOS</strong> and <strong>Windows</strong>, You just have to download docker from the <a target="_blank" href="https://docs.docker.com/get-docker/">official website</a> and then launch the installation.</p>
<p>For <strong>Linux</strong>, you can use the command prompt. Again, the official docker website gives us the procedure. Just follow the steps described <a target="_blank" href="https://docs.docker.com/desktop/install/debian/">here</a>.</p>
<h3 id="heading-lets-try-docker">Let's try Docker</h3>
<p>The main goal of this article is to make you understand the usefulness of docker. We are going to make a simple use case so that you understand better how it works. We are going to retrieve an image and launch it. We are going to containerize a <strong>redis</strong> image on our machine.</p>
<blockquote>
<p><strong>Redis</strong>, which stands for Remote Dictionary Server, is a fast, open source, in-memory, key-value data store. The project started when Salvatore Sanfilippo, the original developer of Redis, wanted to improve the scalability of his Italian startup. From there, he developed Redis, which is now used as a database, cache, message broker, and queue.</p>
<p>Source: <a target="_blank" href="https://aws.amazon.com/redis/?nc1=h_ls">aws redis</a></p>
</blockquote>
<p>On windows or mac, once you have installed docker, make sure it is running, then launch your command prompt.</p>
<p>On Linux, check with:</p>
<pre><code class="lang-bash">sudo service docker status
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675447140238/c1c5916f-2935-47ad-b7f4-637de97b2671.png" alt class="image--center mx-auto" /></p>
<p>Once this is done, go to <a target="_blank" href="https://hub.docker.com/">docker hub</a>, and in the search bar, search for <strong>redis</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675448404195/8a2eb28a-bdc8-40c5-a735-4a9831e4fb20.png" alt class="image--center mx-auto" /></p>
<p>Click on <em>redis official image, now you have</em></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675448523981/d4c9f7d3-0a1b-4b80-a75e-76e6e8fba84b.png" alt class="image--center mx-auto" /></p>
<p>Now, in your terminal, run this command below to get redis image</p>
<pre><code class="lang-bash">docker pull redis
</code></pre>
<p>you will see something like this during the pulling</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675450235093/1cebd684-11a5-4ab2-9afa-e3f01186d2de.png" alt class="image--center mx-auto" /></p>
<p>After that, you can see the list of all available images in your PC with the command:</p>
<pre><code class="lang-bash">docker images
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675450363289/92aff149-e311-481e-b46c-becf9484b3b8.png" alt class="image--center mx-auto" /></p>
<p>Now let's create our docker container from our redis image</p>
<pre><code class="lang-bash">docker run -d redis
</code></pre>
<p><strong>-d</strong> is for detached mode, which means it runs in the background</p>
<p>At this point, the container is created and it is running. We can check with</p>
<pre><code class="lang-bash">docker ps
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675452560608/77f964a1-3d9b-4e0a-8ba1-8c5c72d1b0e2.png" alt class="image--center mx-auto" /></p>
<p>As you can see, my container is running since 18 hours, for you, it's probably since a few minutes.</p>
<p>Now let's get inside our container and use our redis. Run this command below</p>
<pre><code class="lang-bash">docker <span class="hljs-built_in">exec</span> -it adoring_babbage bash
</code></pre>
<p><strong>adoring_babbage</strong> is the name of the container that has automatically been generated by docker when creating our container with <code>docker run</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675454209541/ebe328a3-4ad4-4377-bcb8-1c0c628b33b5.png" alt class="image--center mx-auto" /></p>
<p>Now, we are really inside our container and we can type some unix command like <code>ls</code>, <code>pwd</code>, <code>cd</code>, etc... Let's run redis by typing <code>redis-cli</code> command in our container.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675454481230/be8972e4-2ae6-4f32-9ac0-d89dec5db13b.png" alt class="image--center mx-auto" /></p>
<p>And voilà. We are running redis on our PC using Docker. That's cool.</p>
<h3 id="heading-summary">Summary</h3>
<p>And here we are, we have installed and used redis with docker, without the need to install it on our PC. Now that you have a better understanding of what docker is and what it can do, I invite you to learn more about it. Docker is a great tool and it would be a shame to do without it. This article was meant to be a getting started and therefore quite simple. If you liked it, put a heart to encourage me and share. I'll be back soon with more articles about docker and others subjects.</p>
]]></content:encoded></item></channel></rss>