Skip to main content

Posts

Showing posts from February, 2020

How to run Spring boot application in docker

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

How to find the PORT is in use or not in linux

List all the PORTS whic are in use lsof -i -P -n |grep LISTEN  netstat -tulpn | grep LISTEN Check the specified port is in use or not lsof -i :80 | grep LISTEN It list the files opened in PORT 80