In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the SpringBoot project docker container deployment example analysis, has a certain reference value, interested friends can refer to the next, I hope you read this article after a lot of gains, the following let Xiaobian take you to understand.
Modify docker.service to expose port 2375
Use the command vi /lib/systemd/system/docker.service
After ExecStart=*****, insert the following:
-H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
systemctl daemon-reload
systemctl restart docker
Second, netstat -tulp View port situation
III. Add dependency 1.8 docker.io com.spotify dockerfile-maven-plugin 1.3.6 ${docker.image.prefix}/${project.artifactId} target/${project.build.finalName}.jar Fourth, in the idea Settings->Docker configure the remote docker address
V. Configure Dockerfile
Note: Dockerfile file must be in the same directory as pom.xml and the name must be Dockerfile
When creating a new file, you can directly create a new File file.
#Base image FROM java:8#Owner MAINTAINER luoyi#Copy jar package under target to docker image, modify name to app.jarARG JAR_FILE=target/*.jarCOPY ${JAR_FILE} app.jar #Process at container startup ENTRYPOINT ["java","-jar","/app.jar"]#Expose port, suggest port of host and startup port of this project to keep consistent with a series of ports EXPOSE 8700 VI. Configure docker container and image and other related information
VII. Start-up sequence
1. Now packaged into jar package through maven
2. Run Dockerfile
VIII. Test visits
Thank you for reading this article carefully. I hope that the article "Sample Analysis of Docker Container Deployment of SpringBoot Project" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.