# Dockerization Spring-boot Application

**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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685444577231/94b66c7b-01f9-4266-81f3-ef67816bc534.png align="center")

GitHub code source :- https://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`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685444945478/309c630a-bf0b-4cdd-b2c5-b0588a49233a.png align="center")

**Step 4 :** Now we have to run that docker image

`docker run -p 8080 springboot-docker`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685445101538/1ff0e5c7-171a-4a8a-8f56-7879e1b6971b.png align="center")

**Step 5**: Checking that REST api in postman tool ( Dockerization of Springboot- application completed )

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685445175709/1bf72665-d1f3-45b3-8998-cba04b30e1f3.png align="center")
