<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: RITIK KUMAR</title>
    <description>The latest articles on DEV Community by RITIK KUMAR (@ritikkumar352).</description>
    <link>https://dev.to/ritikkumar352</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2155510%2F672da996-8271-4706-a9c4-dfa19ccc591f.png</url>
      <title>DEV Community: RITIK KUMAR</title>
      <link>https://dev.to/ritikkumar352</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ritikkumar352"/>
    <language>en</language>
    <item>
      <title>Containerization</title>
      <dc:creator>RITIK KUMAR</dc:creator>
      <pubDate>Mon, 31 Mar 2025 18:17:47 +0000</pubDate>
      <link>https://dev.to/ritikkumar352/containerization-o3k</link>
      <guid>https://dev.to/ritikkumar352/containerization-o3k</guid>
      <description>&lt;h3&gt;
  
  
  A Docker container is like a mini PC dedicated to your application, containing everything needed to run it—such as the JDK and other required dependencies, which makes it possible to run anywhere.
&lt;/h3&gt;



&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Imagine this like an application on your phone that you have customized with your favorite theme, sound, and layout. These settings are synced with your account, so no matter which device you use, the app always appears the same. Similarly, a Docker container packages your app along with its necessary configurations, ensuring it runs consistently across any environment&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>docker</category>
      <category>containerization</category>
      <category>webdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>Dockerizing Spring Boot Application: A Beginner's Guide</title>
      <dc:creator>RITIK KUMAR</dc:creator>
      <pubDate>Mon, 31 Mar 2025 18:17:29 +0000</pubDate>
      <link>https://dev.to/ritikkumar352/dockerizing-spring-boot-application-a-beginners-guide-4h8f</link>
      <guid>https://dev.to/ritikkumar352/dockerizing-spring-boot-application-a-beginners-guide-4h8f</guid>
      <description>&lt;p&gt;Hello learners,&lt;br&gt;
If you are reading &lt;strong&gt;How to Dockerize a Spring Boot App&lt;/strong&gt;, I assume you already know what containerization is. If not, don’t worry—learn it in a simpler way by &lt;a href="https://dev.to/ritikku534/containerization-o3k"&gt;clicking here&lt;/a&gt;, or follow these steps below to dockerize your Spring Boot App.&lt;/p&gt;

&lt;p&gt;You have your Spring Boot application up and running, and running Docker Desktop application.&lt;br&gt;
Now, to containerization using Docker follow these steps,&lt;/p&gt;

&lt;h2&gt;
  
  
  1. First, create a .jar file of your Spring Boot application.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open your terminal in the root directory and run the following command:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mvn clean package&lt;/code&gt; OR&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If Maven is not installed, you can use the Maven wrapper. Run the following command: &lt;code&gt;./mvnw clean package&lt;/code&gt; (or use &lt;code&gt;./mvnw clean package -DskipTests&lt;/code&gt; to skip tests before building the .jar file).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Now that your .jar file is in the target folder, create your first Dockerfile.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a file named ‘Dockerfile’ (with no extension) in the root directory. Then add the following contents:&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;FROM openjdk:17-jdk-alpine&lt;br&gt;
WORKDIR /app&lt;br&gt;
COPY target/*.jar app.jar&lt;br&gt;
EXPOSE 8080&lt;br&gt;
ENTRYPOINT ["java","-jar","/app.jar"]&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This will have instructions to install the necessary environment, execute your application, and expose the port where the app will run in the container (and on your host, with port mapping).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Now that you have a Dockerfile, build a Docker image by running the following command, run this cmd
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;docker build -t give_a_img_name .&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Finally, run your Docker container using this command:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;docker run --name give_con_name your-img-name&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Now check you running container running using command: &lt;code&gt;docker ps&lt;/code&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;By the way, this is my first blog ever, so don’t forget to comment your views, feedback, suggestions, or anything else!&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>springboot</category>
      <category>docker</category>
      <category>java</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
