<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jeethesh Kotian on Medium]]></title>
        <description><![CDATA[Stories by Jeethesh Kotian on Medium]]></description>
        <link>https://medium.com/@jeetheshkotian?source=rss-6f4ee4c449a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Z2UW14Vy7MZwW5DJoV0UvQ.jpeg</url>
            <title>Stories by Jeethesh Kotian on Medium</title>
            <link>https://medium.com/@jeetheshkotian?source=rss-6f4ee4c449a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 18:42:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jeetheshkotian/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Docker installation using Docker Toolbox and build React application]]></title>
            <link>https://medium.com/@jeetheshkotian/docker-installation-using-docker-toolbox-and-build-react-application-3a03ea614634?source=rss-6f4ee4c449a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a03ea614634</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[docker-toolbox]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Jeethesh Kotian]]></dc:creator>
            <pubDate>Wed, 13 May 2020 03:39:39 GMT</pubDate>
            <atom:updated>2020-06-10T03:26:47.741Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0aFj2BRQyiPSOwVEUZfuUQ.jpeg" /></figure><h3>How to install Docker using Docker Toolbox and building React Docker image</h3><h4>This post is majorly to help people working on Windows system having windows versions lower then Windows 10 Home basic. I came up with this tutorial after going through a very hardship finding a detailed tutorial in setting up Docker Toolbox and running a React image onto it.</h4><p><em>Most of the posts, documents, and tutorials focus on the Docker Desktop which works on the windows system supporting Hyper-V virtualization.</em><strong><em> So this post will help people working on lower versions of Windows computers </em></strong><em>(i.e.</em><strong><em> </em></strong><em>64-bit operating system running Windows 7 or higher and lesser then 64bit Windows 10 Pro, with Enterprise and Education (1607 Anniversary update, Build 14393 or later)).</em></p><p>Yet, there is an update on the above prerequisite as now Windows OS having Home 2004 version can still install Docker Desktop because of WSL2 feature addition to Windows Home. So if you are using Windows Home, please update your Windows OS to 2004 version and install Docker Desktop.</p><p>References:</p><p>Windows OS update — <a href="https://www.microsoft.com/en-in/software-download/windows10">https://www.microsoft.com/en-in/software-download/windows10</a></p><p>Know more —</p><ul><li><a href="https://www.docker.com/blog/new-docker-desktop-wsl2-backend/">Introducing the Docker Desktop WSL 2 Backend - Docker Blog</a></li><li><a href="https://www.docker.com/blog/docker-desktop-for-windows-home-is-here/">Docker Desktop for Windows Home is here! - Docker Blog</a></li></ul><h4>What is Docker?</h4><p>Docker is a tool that allows developers, sys-admins, etc. to easily deploy their applications in a sandbox (called <em>containers</em>) to run on the host operating system i.e. Linux. The key benefit of Docker is that it allows users to <strong>package an application with all of its dependencies into a standardized unit</strong> for software development. Unlike virtual machines, containers do not have high overhead and hence enable more efficient usage of the underlying system and resources.</p><p>To know more about docker please refer this — <a href="https://docker-curriculum.com/">https://docker-curriculum.com/</a></p><p>Please follow the steps below to install Docker and execute React image:</p><h3>Step 1: Download Docker Toolbox</h3><p>Download the Docker Toolbox from this link — <a href="https://github.com/docker/toolbox/releases">https://github.com/docker/toolbox/releases</a>.</p><p>You should download the latest .exe file</p><blockquote><strong>If you have a newer system, specifically 64bit Windows 10 Pro, with Enterprise and Education (1607 Anniversary update, Build 14393 or later), consider using </strong><a href="https://docs.docker.com/docker-for-windows"><strong>Docker Desktop for Windows</strong></a><strong> instead. And move to Step 3 of this post.</strong></blockquote><h3>Step 2: Install Docker Toolbox on Windows</h3><p>For installing the Docker Toolbox follow the steps specified here — <a href="https://docs.docker.com/toolbox/toolbox_install_windows/">https://docs.docker.com/toolbox/toolbox_install_windows/</a></p><p><strong><em>You may come across some issues during installation and execution. You can find some troubleshooting done below:</em></strong></p><p>1. Make sure to delete Oracle VM VirtualBox if you already have it as it may conflict with the VirtualBox provided with Docker Toolbox.</p><p>2. When you open your <strong>‘Docker Quickstart Terminal’</strong>, you may be asked to select a bash.exe file, this will happen if you have your Git folder in a different folder other then default folder ‘C:\Program Files\Git\bin\bash.exe’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*Afx640RWsc7P-5-r-GxcIw.png" /><figcaption>Missing bash.exe</figcaption></figure><p>Click on Browse and select the bash.exe file.</p><p>You can find the bash.exe in your bin folder under your Git installed folder:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*cNCH_Kyl_EsOTb0343QcyQ.png" /><figcaption>bash.exe inside Git folder</figcaption></figure><blockquote><strong>To permanently fix this issue, do the following step:</strong></blockquote><blockquote>1. Right-click on the shortcut</blockquote><blockquote>2. Select Properties</blockquote><blockquote>3. Edit the Target field to point to the location of bash.exe<br>ex. C:\Users\username\AppData\Local\Programs\Git\bin\bash.exe --login -i &quot;C:\Program Files\Docker Toolbox\start.sh&quot;</blockquote><blockquote>4. Click OK</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*cafO_I8Y9WGUebuTKlS-OQ.png" /><figcaption>Docker Quickstart Terminal Properties update</figcaption></figure><p>3. Say ‘Yes’ to all permission required when you try to open your <strong>‘Docker Quickstart Terminal’.</strong></p><blockquote>Once you successfully open the terminal you will find a default IP, using that IP you will be able to access all your docker work and host application on it and test. Image below:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncOpVesT-uWFmkSXUGI1sQ.png" /><figcaption>Default IP of Virtual machine on which Docker is running</figcaption></figure><h3>Step 3: Creating your first React Application</h3><p>You can check the below link to learn more about installation and creating your first React application.</p><p><a href="https://reactjs.org/docs/create-a-new-react-app.html">https://reactjs.org/docs/create-a-new-react-app.html</a></p><p><em>The basic set of command to create a new react application is as below:</em></p><pre>npx create-react-app my-app<br>cd my-app<br>npm start</pre><h3>Step 4: Create Dockerfile and .dockerignore files</h3><p><strong>1.</strong> Create a file with the name ‘<strong>Dockerfile’ </strong>inside the root folder of the application. Add the below text:</p><pre># pull official base image<br>FROM node:alpine</pre><pre># create working directory<br>RUN mkdir -p /app</pre><pre># set working directory. All command below will be executed on this folder<br>WORKDIR /app</pre><pre># copy dependencies reference file i.e. package.json to app folder<br>COPY package.json ./</pre><pre># install app dependencies and ignore package-lock.json if in case its present<br>RUN npm install --no-package-lock</pre><pre>EXPOSE 3000</pre><pre># add all code to app folder<br>ADD . ./</pre><pre># start app<br>CMD [&quot;npm&quot;, &quot;start&quot;]</pre><p><strong>2. </strong>Create a file with the name<strong> ‘.dockerignore’</strong>. This file will exclude all the files and folders specified from being processed by the docker. In our case, this will exclude the nodemodule folder and other files from being copied while we execute <strong>‘ADD . ./’</strong> command in Dockerfile as <strong>‘npm install’</strong> command will do the needful. Add the below lines in the file:</p><pre>node_modules<br>build<br>.dockerignore<br>Dockerfile<br>package-lock.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*DaNxoMMv1V_-LQMUTuxYOQ.png" /><figcaption>Project structure with docker files</figcaption></figure><h3>Step 5: Build your docker image</h3><p>Open the docker terminal by clicking on <strong>‘Docker Quickstart Terminal’ </strong>and change your directory to the react app root folder.</p><p>Execute the below command to build your docker image:</p><pre>docker build -t react-app-image .</pre><p><em>Syntax:</em></p><pre>docker build -t &lt;tag name&gt; &lt;Dockerfile folder&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*4-IJbypLQQCRu_K00OstXw.png" /><figcaption>docker build command</figcaption></figure><p>After your build is completed you can list all the images using the below command:</p><pre>docker images</pre><p>This will list down all the images you have created, shown in below image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*xQFUGeQmUeBesjBxmYHcaA.png" /><figcaption>docker images</figcaption></figure><h3>Step 6: Running your docker image</h3><p>To run your docker image you need to execute the below command:</p><pre>docker run -it -d -p 3001:3000 react-app-image</pre><p><em>Explanation:</em></p><p>-it — interactive mode, docker container exits as soon as execution completes. To keep npm start running in background we need to enable interactive mode.</p><p>-d — detach, if we don’ t use this option, docker will keep on executing in your terminal and will stop when you close the terminal or you do Ctr+C to exit. This option will detach the execution of a docker container from your terminal and run in the background.</p><p>-p 3001:3000 — define the external port mapping. 3000 port on VM is exposed through 3001 on your host system.</p><p>To check if your docker container is running:</p><pre>docker ps</pre><p>This will list down all the docker container currently running on VM:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iqf60Oo0PlihzHqDj877Vg.png" /></figure><p>You can also check all the inactive and active containers by using the below command:</p><pre>docker ps -a</pre><p>You can get your default IP address by using the below command:</p><pre>docker-machine ip</pre><p>Now go to your browser and type your docker default IP address along with React exposed port number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7FivfpDyJRmwWJlasJQsw.png" /></figure><p><strong><em>Congratulation!!! You successfully build a React docker image and executed it in a container.</em></strong></p><p>To stop the docker container execute the below command:</p><pre>docker stop ac1de1796d4</pre><p><em>Syntax:</em></p><pre>docker stop &lt;container id or container name&gt;</pre><h3>Step 7: Create a docker-compose file</h3><p>To minimize the need to execute build and run commands every time you want to build and run your docker image, it is recommended to have a docker compose file created with all the configuration.</p><p>Create a docker compose file with name <strong>‘docker-compose.yml’</strong> on the root folder of the application and add the below lines:</p><pre>version: &#39;3.7&#39;</pre><pre>services:</pre><pre>react-app-compose:<br>    stdin_open: true <br>    container_name: react-app-compose<br>    build:<br>      context: .<br>      dockerfile: Dockerfile<br>    ports:<br>      - 3001:3000<br>    environment:<br>      - CHOKIDAR_USEPOLLING=true</pre><p><em>Explanation:</em></p><p>stdin_open: true — this is required to make docker compose run the docker file in interactive mode</p><p>CHOKIDAR_USEPOLLING=true — to pool changes to react app and accordingly update docker container</p><p>To run your docker compose, execute the below command:</p><pre>docker-compose up -d</pre><p>-d — detach container execution</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*H7lO4gmqfYDNzsQUhrWGiA.png" /><figcaption>docker compose up</figcaption></figure><p>To check if your container is running:</p><pre>docker ps</pre><p>You can now see your image running in a container:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*utCfwHqTZGAidbqeL7mH6g.png" /></figure><p>Go to your browser and check if the app is running on the docker IP and port 3001.</p><p>To stop the docker compose, execute the below command:</p><pre>docker-compose stop</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*W97BHlcX1lyaPDUZNn5Q6g.png" /><figcaption>docker compose stop</figcaption></figure><p>Huaaarrrry we did it!!!!!!!!!!!!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/0*GmPiFsV8z2sZrBWx.gif" /></figure><h4>Thank you!!! :)</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a03ea614634" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>