简体   繁体   中英

How to dockerize Spring Boot Application?

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"]

在此处输入图像描述

Now what should I do to be able to dockerize?

Assuming your app listens on port 80

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM