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

IDEA remote Management of docker Image and how to implement Container Service

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "IDEA remote management of docker images and container services how to achieve", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "IDEA remote management of docker images and container services how to achieve" it!

Using the command line to manage server images and containers is the most commonly used way for operators, but sometimes we have to operate docker remotely or provide capabilities (configuration administrators, testers) to technicians who are not familiar with docker. In this case, a graphical interface is necessary. It is also true that providing a graphical interface to manipulate docker is more direct and easier than using the command line. Therefore, many manufacturers provide users with graphical interfaces for docker container image management based on docker RESTful API, such as Portainer, Docker UI, Shipyard and so on.

Docker provides the ability to access remote services, namely: docker REST API (providing operation command entry through RESTful HTTP API).

1. Enable docker remote access service

The first thing to be clear is that the docker images and containers on the server are managed through the IDEA editor (remote working host), which belongs to remote service access (that is, access to REST API over the network). The docker daemon does not provide remote access by default, and the configuration file vim / usr/lib/systemd/system/docker.service needs to be modified, which is the first step to turn on the docker remote access service. 0.0.0.0PUR 2375 means that all NICs are listening on port 2375 on the current host.

# modify the ExecStart line ExecStart=/usr/bin/dockerd-H fd://-H tcp://0.0.0.0:2375-H unix:///var/run/docker.sock-- containerd=/run/containerd/containerd.sock

The second step is to reload the configuration file and restart the docker daemon, and use the command below to check that the remote access service is provided correctly. It can also be verified by accessing http://:2375/info through the browser. The response result is correct, and the docker service status and configuration information of a JSON is returned.

# reload the configuration file and restart the docker daemon systemctl daemon-reload & & systemctl restart docker# to check whether the port is open. One line of records shows that port 2375 is listening, that is, the correct netstat-nptl | grep 2375

It is important to note that if your server firewall does not open port 2375 access, please use the following command to open port 2375 (Note: the following command line applies to CentOS7, 8 distribution, if you are other linux distribution, the command may be different).

Firewall-cmd-- zone=public-- add-port=2375/tcp-- permanent; # configuration Open Port firewall-cmd-- reload; # reload configuration II. IDEA installs the Dokcer plug-in

Let's install the plug-in on the IDEA editor of the remote working host, of course, if you have already installed the IDEA editor. Follow the steps shown in the following figure to install the docker plug-in, "File-> Settings-> Plugins-> search Docker-> install installation". You usually need to restart the IDEA editor after the plug-in installation is complete. My IDEA version is 2021.3. This plug-in is integrated by default and does not need to be installed. You may search for a lot of docker-related plug-ins, remember the whale icon in the figure, this is what we need.

Configure the Docker remote access service, as shown in the following figure, fill in tcp://:2375 at Engine API URL, and then save the configuration.

The plug-in installs and saves the configuration, and after completion, a new Tab window appears to manage the Containers (container), Images (image), Networks (network) and Volumes (data volume) on the above configuration service. You can see the number of containers, the running status of the container, the data volume of the container, port mapping and other information. Basic information of images, image deletion, import and export operations are also supported. We can also manage docker networks and manage data volumes, covering almost all the management functions of docker stand-alone services.

So the plug-in IDEA is quite powerful, if we use docker to build some environment, it is almost the most convenient. If you are managing an enterprise service cluster, you still need more advanced graphical interface management tools, such as rancher. At the end of the article, the author has to say that we have omitted a very important content, that is, docker provides HTTP RESTful API remotely, which is a very dangerous behavior without any security measures. Later, the author will introduce how to add certificates for docker remote access service, remote access requests without certificates will be rejected, and HTTPS will be used for network data transmission.

Thank you for your reading. the above is the content of "how to achieve IDEA remote management of docker images and container services". After the study of this article, I believe you have a deeper understanding of how IDEA remotely manages docker images and container services, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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