PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, October 18, 2022

[FIXED] How to dockerize Spring Boot Application?

 October 18, 2022     docker, spring-boot     No comments   

Issue

I want to dockerize my Spring Boot Project. In eclipse, I have already created a Dockerfile (after creating the application jar file) like this:

FROM openjdk:8-jdk-alpine
ARG JAR_FILE=target/device-fixer-1.2.1.jar.jar
COPY ${JAR_FILE} device-fixer-1.2.1.jar.jar
ENTRYPOINT ["java","-jar","/device-fixer-1.2.1.jar.jar"]

enter image description here

Now what should I do to be able to dockerize?


Solution

Assuming your app listens on port 80

docker build -t <your-app-name> .
docker run -d -p 80:80 <your-app-name>


Answered By - Matteo Zanoni
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing