Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How IDEA deploys SpringBoot projects through the Docker plug-in

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces IDEA how to deploy the SpringBoot project through the Docker plug-in, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

1. Configure Docker remote connection port

Locate and edit the docker.service file on the server.

Vi / usr/lib/systemd/system/docker.service

As shown in the following figure, add:

-H tcp://0.0.0.0:2375

2. Restart Docker

Systemctl daemon-reload

Service docker restart

3. The server opens the port

I use the Ali CVM, configure the rules in the security group and open the port.

4. Test whether the remote connection is normal

Curl http://localhost:2375/version

5. Download the Docker plug-in for IDEA

6. Use plug-ins to connect to the Docker container of Ali CVM.

After the connection is successful, you can see the images and containers in Docker.

7. Create a new Dockerfile file under the project

I put it in the root directory of the project, at the same level as pom.xml.

# this is the basic image FROM java:8VOLUME / tmp#, copy the jar package into the image, and change the name to app.jarADD. / target/yun-tool-1.0.jar app.jar# run the command when the container starts (this is actually a Linux command) ENTRYPOINT ["java", "- Djava.security.egd=file:/dev/./urandom", "- jar", "/ app.jar"] 8, add a Docker configuration

9. Use Maven to package the project into jar

10. Run build image

11. Browser access

Http://IP address: Port

Thank you for reading this article carefully. I hope the article "how to deploy the SpringBoot project through the Docker plug-in in IDEA" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report