Dockerization
Docker: - Docker is a platform designed to help developer build ,share and run modern application .
Docker file :- It is a text document , that contain all the commands a user could call on the comand line to assemble an image.
Dockerization : - The process of packing , deploying and running application using Docker containers
Step 1: - Create a REST api in spring boot application and perform the CRUD operation
GitHub code source :- github.com/SourabhAswal/springboot-docker.git
Step 2: - Create a docker file in the project folder
FROM openjdk:17-oracle
EXPOSE 8080
COPY target/springboot-docker.jar springboot-docker.jar
ENTRYPOINT ["java","-jar" ,"springboot-docker.jar"]
Step 3: Create a docker image from the docker file , which we created earlier
Before that you have to build a project so that it will create .jar file by using :
mvn clean install
docker build . -t springboot-docker:latest
Step 4 : Now we have to run that docker image
docker run -p 8080 springboot-docker
Step 5: Checking that REST api in postman tool ( Dockerization of Springboot- application completed )