How to use Portainer to build a visual interface for Docker

How to use Portainer to build a visual interface for Docker

Portainer Introduction

Portainer is a graphical management tool for Docker, which provides status display panel, rapid deployment of application templates, basic operations of container image network data volumes (including uploading and downloading images, creating containers, etc.), event log display, container console operations, centralized management and operation of Swarm clusters and services, login user management and control, etc. The functions are very comprehensive and can basically meet all the container management needs of small and medium-sized units.

Download the Portainer image

#Query the current Portainer images docker search portainer 

Write the picture description here

The above picture shows the portainer image with download volume. We download the first image: docker.io/portainer/portainer.

# Download the image docker pull docker.io/portainer/portainer

Standalone version operation

If there is only one Docker host, you can use the stand-alone version. The stand-alone version of Portainer is very simple to run. Only one statement is needed to start the container to manage the Docker images, containers and other data on the machine.

docker run -d -p 9000:9000 \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
--name prtainer-test \
docker.io/portainer/portainer

This statement associates port 9000 on the host with port 9000 in the container and names the container portainer-test. After executing the command, you can access Portainer using the machine IP:PORT.

Access method: http://IP:9000

The first login requires a registered user and a password for the admin user:

For the stand-alone version, just select local. After selecting, click Connect to connect to the local docker:

Note: This page prompts you to mount the local /var/run/docker.socker to connect to the /var/run/docker.socker in the container. Therefore, the mount file must be specified at startup.

front page:

Container list:

Click the container name in the container list to view the container details:

And you can use the container to create an image on the container details page:

Mirror list (in the mirror list, you can directly pull a mirror, either from a remote location or from a private library. To pull from a private library, you need to configure the address of the private library in advance, which will be discussed later):

Click the image ID to view the image details. On the details page, in addition to some information about the image, you can also tag the image and then push the image to a remote repository or a private repository.

Warehouse management page (this interface can view the list of configured image warehouses, and you can add warehouses. After adding successfully, you can perform pull and push operations on the image mirror page.):

Add a mirror repository:

There are some other operations in Portainer, such as permission management, network management, etc. You can install it to learn about it.

Cluster operation

In most cases, we will have a Docker cluster, which may have several machines or dozens of machines. Therefore, cluster management is very important. Portainer also supports cluster management. Portainer can perform cluster management operations together with Swarm. Here I first built a Swarm.

For how to build a Swarm cluster, please refer to this article: Building a Docker cluster with Swarm.

Start portainer in cluster mode (here I like to start it simply and then add nodes on the interface):

docker run -d -p 9000:9000 --restart=always --name prtainer-test docker.io/portainer/portainer

After starting Portainer, the home page still sets a password for the admin user (the same as for stand-alone startup). The next step is to set up the nodes, as shown below:

Here we select the Remote module. You will be asked to add a name and node URL. You can choose any name as long as you can understand it. The Endpoint URL is the node URL set in the Swarm cluster. For example, my machine IP is 10.0.11.152 and the listening port is the default 2375, so the URL here is: 10.0.11.152:2375.

If it is started in cluster mode, it is recommended that portainer be installed and started on the Swarm management node, and the URL of the management node be set when setting the Endpoint URL for the first time.

After filling in the form, click Connect to enter the management page. A list of managed cluster nodes will be displayed in the upper left corner of the management page:

To view the information of a node, click on it. The image and container operations are basically the same as in stand-alone mode. Here we only need to talk about node addition.

Click Endpoints in the navigation bar to enter the node list page:

From the above picture, you should know how to add a node at a glance. You need to fill in a name, Endpoint URL and node IP, and then you can add a cluster node. It is very simple.

OK, that’s all the basic operations of Portainer. You still need to learn and understand the specific operation steps by yourself.

This is the end of this article about how to use Portainer to build a visual interface for Docker. For more information about the Docker visual interface, 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:
  • Detailed explanation of docker visualization graphics tool portainer
  • Deployment and Chinese translation of the docker visualization tool Portainer
  • Installation and usage analysis of Portainer, a visual UI management tool for Docker
  • Detailed steps for building Portainer visual interface with Docker
  • Use of Docker Portainer visualization panel

<<:  Tutorial on using the frameset tag in HTML

>>:  mysqldump parameters you may not know

Recommend

Using js to realize dynamic background

This article example shares the specific code of ...

mysql solves the problem of finding records where two or more fields are NULL

Core code /*-------------------------------- Find...

Problems with index and FROM_UNIXTIME in mysql

Zero, Background I received a lot of alerts this ...

Detailed process of compiling and installing Storm on Kylin V10 server

1 Introduction Apache Storm is a free, open sourc...

Summary of 10 amazing tricks of Element-UI

Table of contents el-scrollbar scroll bar el-uplo...

What are the benefits of semantic HTML structure?

one: 1. Semantic tags are just HTML, there is no ...

React Native scaffolding basic usage detailed explanation

Build the project Execute the command line in the...

Summary of 7 reasons why Docker is not suitable for deploying databases

Docker has been very popular in the past two year...

How to install MySQL for beginners (proven effective)

1. Software Download MySQL download and installat...

Example code for text origami effect using CSS3

Preface This article mainly shares with you an ex...

The difference between animation and transition

The difference between CSS3 animation and JS anim...

A brief talk about MySQL semi-synchronous replication

Introduction MySQL achieves high availability of ...

How to move a red rectangle with the mouse in Linux character terminal

Everything is a file! UNIX has already said it. E...