SlideShare a Scribd company logo
A Java Microservices project using Spring Boot
deployment on Docker – Hands-on Case Study.
Mr. Subramanyam Tirumani Vemala
subramanyam.vemala@capgemini.com
Detailed Steps:
This document contains the detailed steps with screenshots, to setup a Java Microservices project using Spring Boot, generate jar and deploy it on Docker:
Target Audience:
All, with knowledge of Java or coding and Containerization.
Artifacts needed:
1. JDK11
2. Eclipse – IDE
3. Docker
4. Internet
Implementation Steps:
1. Create a Spring Starter Project.
2. Add the necessary classes and dependencies in the pom.xml
3. Run as Spring Boot App on the Eclipse. Check for the output both on the Console and the Browser.
4. Create the jar in the target folder, through maven install.
5. Create Dockerfile.
6. Use Build command to create the Docker image.
7. Run the command to deploy the Docker image.
8. Check the expected output on the Browser.
File – New – Spring Starter Project - Create
Provide the project details:
Choose the dependencies - Actuator:
Choose the dependencies - DevTools:
Choose the dependencies – Spring Web:
Project is created (subbu-case-study):
pom.xml – Deployment descriptor
Give the jar name in the pom.xml:
Create Controller with GetMapping and
RestController:
Create Dockerfile:
JRE System Library:
Maven Dependencies:
Run as a Spring Boot App:
Tomcat started successfully and message can
be seen on Console:
Run as Maven Install to create jar:
Jar is created in the Target folder:
http://localhost:8080
http://127.0.0.1:8080/message
http://localhost:8080/message
Launch Power Shell – goto the Dockerfile
folder:
Build the Docker image using the Dockerfile using
the command: docker build –t <jar name> .
Docker Image created: docker ps
Run the Docker image using the command: docker run –p
<port number mapped to the exposed port>:<Exposed port>
<jar name>
http://localhost:9091/message
http://127.0.0.1:9091/message
Stop the application:
Application is stopped:
Check for the output on the browser - Now no output, on the
browser as the application is stopped:
http://localhost:8080/message
Kill the tasks if the port has been used by
other services - optional:
Kill the tasks if the port has been used by
other services - optional:
C:Userssvemala>netstat -ano | findstr :9080
TCP 0.0.0.0:9080 0.0.0.0:0 LISTENING 31576
TCP [::]:9080 [::]:0 LISTENING 31576
C:Userssvemala>taskkill /PID 31576 /F
SUCCESS: The process with PID 31576 has been terminated.
C:Userssvemala>
C:Userssvemalaeclipse-workspacesubbu-
case-study
Appendix:
Download the code from public GitGub:
1. HTTPS:
https://github.com/subbugh/java-microservices-springboot-docker.git
2. SSH:
git@github.com:subbugh/java-microservices-springboot-docker.git
3. Code Zip file:

More Related Content

What's hot (20)

PPTX
Jenkins
MohanRaviRohitth
 
PDF
Secure Your Code Implement DevSecOps in Azure
kloia
 
PDF
Introduction to container based virtualization with docker
Bangladesh Network Operators Group
 
PDF
Building layers of defense for your application
VMware Tanzu
 
PPTX
Spring Security 5
Jesus Perez Franco
 
PDF
API for Beginners
Gustavo De Vita
 
PDF
Spring Boot Interview Questions | Edureka
Edureka!
 
PDF
Comparing Native Java REST API Frameworks - Seattle JUG 2022
Matt Raible
 
PPTX
Installing and running Postfix within a docker container from the command line
dotCloud
 
PPTX
Introduction 2 linux
Papu Kumar
 
PPTX
Network architecture design for microservices on GCP
Raphaël FRAYSSE
 
PDF
Docker London: Container Security
Phil Estes
 
PPTX
A Distributed Malware Analysis System Cuckoo Sandbox
Andy Lee
 
PPTX
Linux kernel
Goutam Sahoo
 
PPTX
Docker Container Security
Suraj Khetani
 
PPTX
Hacking and securing ios applications
Satish b
 
PDF
Docker Overview - Rise of the Containers
Ryan Hodgin
 
PDF
Scalable complex event processing on samza @UBER
Shuyi Chen
 
PPTX
Azure Pipelines
Mithun Shanbhag
 
PPTX
Security and DevOps Overview
Adrian Sanabria
 
Secure Your Code Implement DevSecOps in Azure
kloia
 
Introduction to container based virtualization with docker
Bangladesh Network Operators Group
 
Building layers of defense for your application
VMware Tanzu
 
Spring Security 5
Jesus Perez Franco
 
API for Beginners
Gustavo De Vita
 
Spring Boot Interview Questions | Edureka
Edureka!
 
Comparing Native Java REST API Frameworks - Seattle JUG 2022
Matt Raible
 
Installing and running Postfix within a docker container from the command line
dotCloud
 
Introduction 2 linux
Papu Kumar
 
Network architecture design for microservices on GCP
Raphaël FRAYSSE
 
Docker London: Container Security
Phil Estes
 
A Distributed Malware Analysis System Cuckoo Sandbox
Andy Lee
 
Linux kernel
Goutam Sahoo
 
Docker Container Security
Suraj Khetani
 
Hacking and securing ios applications
Satish b
 
Docker Overview - Rise of the Containers
Ryan Hodgin
 
Scalable complex event processing on samza @UBER
Shuyi Chen
 
Azure Pipelines
Mithun Shanbhag
 
Security and DevOps Overview
Adrian Sanabria
 

Similar to A Java Microservices Spring Boot and Docker case study. (20)

PPTX
Java microservicesdockerdockerhubusecase2
Subramanyam Vemala
 
PPTX
Create Microservice with Spring Boot and Docker
Sivaprakash
 
PDF
Containerize spring boot application with docker
Sunil kumar Mohanty
 
PDF
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Chris Richardson
 
PDF
BelfastJUG, Spring Boot + Docker
Hudson Mendes
 
PDF
Belfast JUG, Spring Boot & Docker
Hudson Mendes
 
PDF
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Codefresh
 
PPTX
Docker and Microservice
Samuel Chow
 
PDF
Docker+java
DPC Consulting Ltd
 
PDF
Docker for Java Developers
Imesh Gunaratne
 
PDF
How to Dockerize Web Application using Docker Compose
Evoke Technologies
 
PPT
TransitioningToMicroServonDocker_MS
Lana Kalashnyk
 
PDF
Docker for Java Developers - Fabiane Nardon and Arun gupta
Docker, Inc.
 
PPTX
Michal Kordas "Docker: Good, Bad or Both"
LogeekNightUkraine
 
PDF
Vagrant or docker for java dev environment
Orest Ivasiv
 
PDF
Разработка cloud-native Java-приложений для Kubernetes, Егор Волков,Senior Ja...
DataArt
 
PDF
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
PDF
Docker and Springboot by Clavrit Digital Solutions
Clavrit Digital Solutions
 
PDF
Deploying Spring Boot applications with Docker (east bay cloud meetup dec 2014)
Chris Richardson
 
PDF
DCSF19 Docker Containers & Java: What I Wish I Had Been Told
Docker, Inc.
 
Java microservicesdockerdockerhubusecase2
Subramanyam Vemala
 
Create Microservice with Spring Boot and Docker
Sivaprakash
 
Containerize spring boot application with docker
Sunil kumar Mohanty
 
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Chris Richardson
 
BelfastJUG, Spring Boot + Docker
Hudson Mendes
 
Belfast JUG, Spring Boot & Docker
Hudson Mendes
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Codefresh
 
Docker and Microservice
Samuel Chow
 
Docker+java
DPC Consulting Ltd
 
Docker for Java Developers
Imesh Gunaratne
 
How to Dockerize Web Application using Docker Compose
Evoke Technologies
 
TransitioningToMicroServonDocker_MS
Lana Kalashnyk
 
Docker for Java Developers - Fabiane Nardon and Arun gupta
Docker, Inc.
 
Michal Kordas "Docker: Good, Bad or Both"
LogeekNightUkraine
 
Vagrant or docker for java dev environment
Orest Ivasiv
 
Разработка cloud-native Java-приложений для Kubernetes, Егор Волков,Senior Ja...
DataArt
 
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Docker and Springboot by Clavrit Digital Solutions
Clavrit Digital Solutions
 
Deploying Spring Boot applications with Docker (east bay cloud meetup dec 2014)
Chris Richardson
 
DCSF19 Docker Containers & Java: What I Wish I Had Been Told
Docker, Inc.
 
Ad

More from Subramanyam Vemala (14)

PPTX
Domain Driven Development (DDD)
Subramanyam Vemala
 
PPTX
AWS Amazon Quantum Ledger Database (QLDB)
Subramanyam Vemala
 
PDF
Java microservicesspringbootcasestudy2
Subramanyam Vemala
 
PPTX
Aws centralized logs
Subramanyam Vemala
 
PPTX
AWS SNS - Notifications through SMS and Email
Subramanyam Vemala
 
PPTX
Creating AppStream users through User Pool
Subramanyam Vemala
 
PPTX
Creating AppStream apps and configuring users with Domain Join.
Subramanyam Vemala
 
PPTX
AWS CodeCommit – Securing the Repository and Branches
Subramanyam Vemala
 
PPTX
AWS IAM User Setup for CodeCommit
Subramanyam Vemala
 
PPTX
AWS CodeCommit Setup
Subramanyam Vemala
 
PPTX
Migration architecture on_prem
Subramanyam Vemala
 
PPTX
Aws managed microsoft ad
Subramanyam Vemala
 
PPTX
AWS AD Connector - SSO - Directory Service - Cloud
Subramanyam Vemala
 
PPTX
Aws over view_demoppt
Subramanyam Vemala
 
Domain Driven Development (DDD)
Subramanyam Vemala
 
AWS Amazon Quantum Ledger Database (QLDB)
Subramanyam Vemala
 
Java microservicesspringbootcasestudy2
Subramanyam Vemala
 
Aws centralized logs
Subramanyam Vemala
 
AWS SNS - Notifications through SMS and Email
Subramanyam Vemala
 
Creating AppStream users through User Pool
Subramanyam Vemala
 
Creating AppStream apps and configuring users with Domain Join.
Subramanyam Vemala
 
AWS CodeCommit – Securing the Repository and Branches
Subramanyam Vemala
 
AWS IAM User Setup for CodeCommit
Subramanyam Vemala
 
AWS CodeCommit Setup
Subramanyam Vemala
 
Migration architecture on_prem
Subramanyam Vemala
 
Aws managed microsoft ad
Subramanyam Vemala
 
AWS AD Connector - SSO - Directory Service - Cloud
Subramanyam Vemala
 
Aws over view_demoppt
Subramanyam Vemala
 
Ad

Recently uploaded (20)

PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PPTX
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
PDF
Is Framer the Future of AI Powered No-Code Development?
Isla Pandora
 
PDF
Simplify React app login with asgardeo-sdk
vaibhav289687
 
PDF
NPD Software -Omnex systems
omnex systems
 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
PDF
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PDF
Why is partnering with a SaaS development company crucial for enterprise succ...
Nextbrain Technologies
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
Is Framer the Future of AI Powered No-Code Development?
Isla Pandora
 
Simplify React app login with asgardeo-sdk
vaibhav289687
 
NPD Software -Omnex systems
omnex systems
 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
Why is partnering with a SaaS development company crucial for enterprise succ...
Nextbrain Technologies
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 

A Java Microservices Spring Boot and Docker case study.