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 to use Portainer.io to monitor and manage Docker containers

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Editor to share with you how to use Portainer.io to monitor and manage Docker containers. I hope you will learn something after reading this article. Let's discuss it together.

Monitor docker container image root@linuxtechi ~} $docker ps-aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES9ab9aa72f015 ubuntu "/ bin/bash" 14 seconds ago Exited (0) 12 seconds ago suspicious_shannon305369d3b2bb centos " / bin/bash "24 seconds ago Exited (0) 22 seconds ago admiring_mestorf9a669f3dc4f6 portainer/portainer" / portainer "7 minutes ago Up 7 minutes 0.0.0.0 portainer 9000-> 9000/tcp trusting_keller

Including portainer (docker container image), all docker images that have been exited and are currently running will be displayed. The Portainer GUI screenshot below shows the same situation.

Docker_status

Monitoring event

Click the Events option on the portainer page, as shown below.

Events generated and created based on docker container activities will be extracted and displayed on this page.

Container-Events-Poratiner-GUI

Now check and verify how the "Events" section works. Create a new docker container image redis, as described below, and check the status on the docker command line: docker ps-a:

Root@linuxtechi ~} $docker ps-aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMEScdbfbef59c31 redis "docker-entrypoint.s …" About a minute ago Up About a minute 6379/tcp angry_varahamihira9ab9aa72f015 ubuntu "/ bin/bash" 10 minutes ago Exited (0) 10 minutes ago suspicious_shannon305369d3b2bb centos "/ bin/bash" 11 minutes ago Exited (0) 11 minutes ago Admiring_mestorf9a669f3dc4f6 portainer/portainer "/ portainer" 17 minutes ago Up 17 minutes 0.0.0.0 minutes ago Up 9000-> 9000/tcp trusting_keller

Click "Event List" at the top to refresh the event list

Events_updated

Now the page of the event has also updated this change.

Host statu

The following is a screenshot of portainer showing the status of the host. This is a simple window. This shows the basic information of the host Linux machine, such as "CPU", "hostname", "operating system information", and so on. This page provides very useful information for quick browsing without the need to log on to the host command line.

Host-names-Portainer

Dashboard in Portainer

So far, we have seen various features based on portainer in the "Local" section. Now skip to the "Dashboard" section of the selected Docker container image.

When you click the "EndPoint" option in the Portainer web page, the following window appears:

End_Point_Settings

For host container mirroring, this dashboard has many states and options.

Stacks

Click this option to provide the status of any stack, if any. Because there is no stack, it is displayed as zero.

Images

Click this option to provide the container images available in the host. This option displays all active and exited container images.

Docker-Container-Images-Portainer

For example, create another "Nginx" container and refresh the list to see the update:

Root@linuxtechi ~} $sudo docker run nginxUnable to find image 'nginx:latest' locallylatest: Pulling from library/nginx27833a3ba0a5: Pull completeea005e36e544: Pull completed172c7f0578d: Pull completeDigest: sha256:e71b1bf4281f25533cf15e6e5f9be4dac74d2328152edf7ecde23abc54e16c1cStatus: Downloaded newer image for nginx:latest

The following is the refreshed image interface:

Nginx_Image_creation

When the Nginx image is in stopped/killed state, the container image of docker changes to unused state.

Note: you can see that the details of all the images here are very clear, such as memory usage, date and time of creation. Compared to the command line option, it will be very easy to maintain and monitor the container from here.

Networks

This option is used for network operations. Examples include assigning IP addresses, creating subnets, providing a range of IP addresses, and access control (administrators and ordinary users). The following window provides details of the various possible options. According to your needs, you can further study these options by yourself.

Conatiner-Network-Portainer

After entering all the various network parameters, click the "create network" button to create the network.

Container

This option provides container status. This list provides more information about the status of active and unrunning containers. This output is similar to the docker ps command option.

Containers-Status-Portainer

In this window, you can control the container to stop and start as needed by selecting the check box and selecting the above button. An example is as follows:

For example, the "CentOS" and "Ubuntu" containers are both stopped and can now be started by selecting the check box and clicking the "Start" button.

Start_containers1

Start_containers2

Note: because both of these are Linux container images, they will not be started. Portainer tried to start, but stopped later. Try starting "Nginx" and you will see that it becomes running.

Start_containers3

Volume

See the first part of this article.

Setting options in Portainer

So far, we have seen various features based on portainer in the "Local" section. Now skip to the "Settings" section of the selected Docker container image.

When you click the Settings option in Portainer's web page, you can use the following configuration options:

Extensions

This is a simple Portainer CE subscriber. Details and usage can be seen in the attached window. This is mainly used to maintain licenses and subscriptions for the corresponding versions.

Extensions

Users

This option is used to add users with or without administrative privileges. The following example provides the same example.

In this example, enter your desired user name such as "shashi" and your chosen password, and then click the "Create User" button below.

Create_user_portainer

Create_user2_portainer

Internal-user-Portainer

Similarly, you can delete the newly created user "shashi" by selecting the check box and clicking the "remove" button.

User_remove_portainer

Endpoints

This option is used for endpoint management. Terminals can be added and deleted, as shown in the attached window.

Endpoint-Portainer-GUI

The new terminal "shashi" is created using various default parameters shown below

Endpoint2-Portainer-GUI

Similarly, you can remove this endpoint by clicking the check box and clicking the remove button.

Registries

This option is used for registration management. Because docker hub has registrations for various images, this feature can be used for similar purposes.

Registry-Portainer-GUI

You can create a "shashi-registry" using the default options.

Registry2-Portainer-GUI

Again, if you don't need it, you can remove it.

Settings

This option is used to set the following options

Set snapshot interval

Set up a custom logo

Create an external template

Security features, such as disabling and enabling bin mounting for non-administrators, disabling / enabling permissions for non-administrators, and enabling host management functions

The screenshot below shows some of the options enabled and disabled for demonstration purposes. Once all is done, click the "Save Settings" button to save all of these options.

Portainer-GUI-Settings

Clicking "Authentication settings" now pops up the LDAP, Internal, and OAuth (extension) options, as shown below:

After reading this article, I believe you have some understanding of "how to use Portainer.io to monitor and manage Docker containers". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

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

Servers

Wechat

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

12
Report