Steps to run the springboot application in docker
Step 1: Create Spring boot application and build Jar file
Step 2: Create Dockerfile in the application root file

Step 3: Add the following lines in Dockerfile
FROM openjdk:8
COPY /target/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
Step 4: Build the Docker image
sudo docker build -t kavinduraisamy91/springboot-docker-sample .
Step 5: Run the image
sudo docker run -p 8080:40 -t kavinduraisamy91/springboot-docker-sample:latest
Step 1: Create Spring boot application and build Jar file
Step 2: Create Dockerfile in the application root file

Step 3: Add the following lines in Dockerfile
FROM openjdk:8
COPY /target/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
Step 4: Build the Docker image
sudo docker build -t kavinduraisamy91/springboot-docker-sample .
Step 5: Run the image
sudo docker run -p 8080:40 -t kavinduraisamy91/springboot-docker-sample:latest
Comments
Post a Comment