Wednesday 30 November 2022

Building Spring boot application manually and run it with the Docker Container

git clone

 cd spring-boot-websocket-chat-demo/

 cat Dockerfile

# Start with a base image containing Java runtime

FROM openjdk:11

# Add Maintainer Info

MAINTAINER Rajeev Kumar Singh <>

# Add a volume pointing to /tmp


# Make port 8080 available to the world outside this container


# The application's jar file

ARG JAR_FILE=target/websocket-demo-0.0.1-SNAPSHOT.jar

# Add the application's jar to the container

ADD ${JAR_FILE} websocket-demo.jar

# Run the jar file

ENTRYPOINT ["java","","-jar","/websocket-demo.jar"]

mvn clean package

sudo docker build -t webchat .

sudo docker images

sudo docker run -p 5000:8080 --name web_chat webchat


No comments:

Post a Comment