Detailed explanation of the process of deploying SpringBoot project through Docker plug-in in IDEA

Detailed explanation of the process of deploying SpringBoot project through Docker plug-in in IDEA

1. Configure Docker remote connection port

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

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

As shown in the figure below, add:

-H tcp://0.0.0.0:2375

insert image description here

2. Restart Docker

systemctl daemon-reload

service docker restart

3. Server open ports

I use Alibaba Cloud Server and open ports in the configuration rules of the security group.

insert image description here

4. Test whether the remote connection is normal

curl http://localhost:2375/version

5. Download the Docker plugin from IDEA

![Insert image description here](https://img-blog.csdnimg.cn/e482a24adc3845f387a3378998b02db0.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA56iL5bqP5ZGY5LqR5biG5ZOl,size_20,color_FFFFFF,t_70,g_se,x_16

6. Use the plugin to connect to the Docker container of the Alibaba Cloud server

insert image description here

After the connection is successful, you can see the image and container in Docker

insert image description here

7. Create a new Dockerfile file under the project

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

#This is the base image FROM java:8
VOLUME /tmp
#Copy the jar package to the image and change the name to app.jar
ADD ./target/yun-tool-1.0.jar app.jar
#Run the command when the container starts to start our project (this is actually a Linux command)
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

8. Add a Docker configuration

insert image description here

9. Use Maven to package the project into a jar package

insert image description here

10. Run the build image

insert image description here

11. Browser access

http://IP address:port

This is the end of this article about deploying SpringBoot projects in IDEA through the Docker plug-in. For more information about deploying SpringBoot projects with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • The whole process of IDEA integrating docker to deploy springboot project
  • How to configure docker in IDEA2021.2 to image the springboot project and release it with one click
  • Detailed steps to deploy SpringBoot projects using Docker in Idea
  • Detailed tutorial on how to publish springboot projects through docker plug-in in IDEA
  • Deploy the springboot project to docker based on idea

<<:  Detailed introduction to CSS priority knowledge

>>:  Detailed explanation of transactions and indexes in MySQL database

Recommend

Learn about JavaScript closure functions in one article

Table of contents Variable Scope The concept of c...

Docker dynamically exposes ports to containers

View the IP address of the Container docker inspe...

Vue implements multi-tab component

To see the effect directly, a right-click menu ha...

How to install ROS Noetic in Ubuntu 20.04

Disclaimer: Since the project requires the use of...

Summary of all HTML interview questions

1. The role of doctype, the difference between st...

Analysis of statement execution order of sql and MySQL

I encountered a problem today: Can I use the as a...

Tudou.com front-end overview

1. Division of labor and process <br />At T...

MySQL 8.0.12 Quick Installation Tutorial

The installation of MySQL 8.0.12 took two days an...

A brief discussion on docker-compose network settings

Networks usage tutorial Official website docker-c...

jQuery implements font size adjustment case

This article shares the specific code of jQuery t...

MySQL 5.7.24 installation and configuration method graphic tutorial

MySQL is the most popular relational database man...

Use nginx + secondary domain name + https support

Step 1: Add a secondary domain name to the Alibab...

Nginx Service Quick Start Tutorial

Table of contents 1. Introduction to Nginx 1. Wha...

CSS to achieve dynamic secondary menu

Dynamically implement a simple secondary menu Whe...

How to fix the width of table in ie8 and chrome

When the above settings are used in IE8 and Chrome...