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

A preliminary understanding of CSS custom properties

Today, CSS preprocessors are the standard for web...

Detailed explanation of galera-cluster deployment in cluster mode of MySQL

Table of contents 1: Introduction to galera-clust...

How to deploy code-server using docker

Pull the image # docker pull codercom/code-server...

How to enhance Linux and Unix server security

Network security is a very important topic, and t...

Practice of using SuperMap in Vue

Table of contents Preface Related Materials Vue p...

Common problems in implementing the progress bar function of vue Nprogress

NProgress is the progress bar that appears at the...

Write a shopping mall card coupon using CSS in three steps

Today is 618, and all major shopping malls are ho...

Detailed explanation of how to use the mysql backup script mysqldump

This article shares the MySQL backup script for y...

Implementation of nginx flow control and access control

nginx traffic control Rate-limiting is a very use...

Introduction to TypeScript interfaces

Table of contents 1. Interface definition 2. Attr...

Graphic tutorial on installing tomcat8 on centos7.X Linux system

1. Create the tomcat installation path mkdir /usr...

Solve the problem of Mac Docker x509 certificate

question Recently I needed to log in to a private...

How to set Tomcat as an automatically started service? The quickest way

Set Tomcat to automatically start the service: I ...

A QQ chat room based on vue.js

Table of contents Introduction The following is a...