Springboot project packaging Docker image
IDEA installs Docker
, creates a Dockerfile in the project directory,
edits the Dockerfile
FROM java:8
COPY *.jar /app.jar
CMD ["--server.port=8080"]
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app.jar"]
Upload the jar package and Dockerfile to the server.
Enter the server to store the uploaded files and generate a mirror image
docker build -t springtoot
Start the container
docker run -d -P --name springboot01 springtoot
Test container
curl localhost:49161