Idea configures the docker service connected to the Linux environment

Table of contents

1. In Linux environment, configure the docker service port

2. In Linux environment, restart the docker service

3. In the development environment, configure docker in IDEA


1. In Linux environment, configure the docker service port

 1) Confirm whether Docker ’s default port [port 2375] has been opened and run the command [netstat -nlpt]

As shown in the picture above, there is no 2375 port, so you need to configure port 2375.

2) Enter the command [systemctl status docker.service] to query the docker service

[root@VM-16-5-centos system]# systemctl status docker.service

The result is as follows:

 You can see the path of docker.service:/usr/lib/systemd/system/docker.service

 Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)

3) Edit the docker.service file,

[root@VM-16-5-centos system]# vim docker.service

Add the following content after the ExecStart line

-H tcp://0.0.0.0:2375

As shown below:

 Save and exit.

2. In Linux environment, restart the docker service

1) Reload service information.

[root@VM-16-5-centos system]# systemctl daemon-reload

2) Restart the docker service

[root@VM-16-5-centos system]# systemctl restart docker.service

3) Check whether port 2375 is open

[root@VM-16-5-centos system]# netstat -nlpt

As shown below:

3. In the development environment, configure docker in IDEA

1) Download the Docker plug-in and restart IDEA

2) Set Docker’s [TCP socket] in the setting (http://{linux server IP}:{docker port}). After setting, make sure the status below is [Connection successful], which means the connection is successful !

3) In addition, in the service window of idea, you can see the docker image installed on the server and the running container. (As of this afternoon, mysql and redis images have been installed on my server and the containers are running)

Note: If the docker service cannot be connected, you need to check whether the Linux firewall has also opened the corresponding port. For Linux firewall methods, please refer to: Common Linux Firewall Operations and Port Opening_weixin_38819951's Blog-CSDN Blog_Linux Protection Wall Port Opening

Guess you like

Origin blog.csdn.net/louis_lee7812/article/details/127513400