For beginners of Docker, a good visualization tool is helpful to quickly master the basic form and concept of Docker. The following is a summary of docker visualization tools

ui-for-docker

UI For Docker is a use of Docker RemoteAPIThe purpose of the web interface is to provide a clean and clean client implementation, in order to connect and manage Docker;This tool is currently unmaintained and it is recommended to use the Portainer described below docker run -it -d --name docker-web --restart always -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock docker.io/uifd/ui-for-docker

Portainer

www.portainer.io/installatio…Docker Is a Docker visual management tool that allows you to easily build and manage Containers in Docker, Docker Swarm, Kubernetes and Azure ACI. Portainer hides the complexity of managing containers behind an easy-to-use UI. By eliminating the need to use the CLI, write YAML, or understand a manifest, Portainer makes deploying applications and solving problems so easy that anyone can do it

Portainer – architecture

The Portainer consists of two elements: the Portainer server and the Portainer agent. Both run as lightweight containers on top of your existing containerization infrastructure. The Portainer agent should be deployed to each node in the cluster and configured to report to the Portainer server container. A single Portainer server will accept connections from any number of Portainer agents, providing the ability to manage multiple clusters from a centralized interface. To do this, the Portainer Server container requires data persistence. The Portainer agent is stateless and the data is passed back to the Portainer server container.

Installed Portainer –

Run the following two commands. These commands create a volume dedicated to Portainer, and then create and run containers on ports 8000 and 9000.

  1. Local container-based deployment

/var/run/ Docker. Sock ** if you use Portainer to manage local Docker hosts, you need to bind /var/run/docker. And run in the docker docker) * * dockervolumecreateportainerdatadocker volume create portainer_datadockervolumecreateportainerdata docker run –name portainer –restart always -d -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Then open the corresponding address in the browser and you will see that it is running successfully. When running for the first time, you need to set up the account, and then select the Docker host to manage.

Note: Portainer /portainer is the image name of Portainer v1.24.x, now deprecated; Starting in January 2022, All new versions of Portainer 2.0 will release Docker run -d P 8000:8000-p 9443:9443 — Name Portainer in Portainer/Portainer-CE – restart = always – v/var/run/docker. The sock: / var/run/docker. The sock – v portainer_data: / data portainer/portainer – ce: 2.11.1

  1. Connect to the deployment of the remote container

docker run -d -p 9000:9000 –name portainer –restart always -v portainer_data:/data portainer/portainer -H tcp://<REMOTE_HOST>:<REMOTE_PORT> ​

Ps: The remote after -h is the docker you want to manage with Portainert

Add a new container cluster environment

1. Local connection mode

The local environment can only be added when creating the Portainer Server container. After deploying Portainer, you cannot add a local environment

Sock is used to communicate with the Docker daemon by mounting /var/run/docker.sock as shown in the figure below.

Then you can see the Docker containers running on the machine, click them can also carry out container management.

The entry on the left can manage volumes, create containers, view host information, and so on. Pretty much everything you need

2. Remote connection

In this way, remote machines can be added to the Portainer server to centrally manage the container environment on the remote machines

When connecting the Docker Standalone host to the Portainer, you can use two methods. You can connect directly to the Docker API via TCP, or you can install the Portainer agent on the Docker Standalone host and connect via the agent. Docs. Portainer. IO/ce/v – 2.11 / a…

1) Remotely access the TCP: 2375 port binding environment Use Remote to enable the docker daemon thread listening port on the managed host. Add the following configuration {“hosts” to /etc/dock/daemon. json: [TCP: / / 0.0.0.0: “2375”, “Unix: / / / var/run/docker. The sock”]}

2) Manage the Docker environment through Portainer Agent Docs. Portainer. IO/ce/v – 2.11 / s…Docker run -d -p 9001:9001 –name portainer_agent –restart=always -v The/var/run/docker. The sock: / var/run/docker. The sock – v/var/lib/docker/volumes: / var/lib/docker/volumes portainer/agent: 2.11.1 3) Manage the K8S cluster environment by Portainer Agent

Run the following command on the K8S cluster url -L Downloads. Portainer. IO/portainer – a… -o portainer-agent-k8s.yaml; kubectl apply -f portainer-agent-k8s.yaml

After the Agent is deployed on the remote K8S cluster, the service is configured on the Portainer server through nodePort or targetPort to complete the connection configuration of the K8S cluster.

LazyDocker

Github.com/jesseduffie…

LazyDocker is a terminal-based visual query tool that supports keyboard and mouse clicks. It may not be as professional as Portainer, but it’s probably better for developers. Because most developers use the command line to run Docker, they can use LazyDocker for occasional graphical viewing.

Specific features of Lazydocker are as follows:

  • View the state of the Docker or Docker-compose container environment in full view
  • View logs for containers or services
  • Look at the ASCII chart of container metrics so you can be more of a developer
  • Customize charts to measure different metrics
  • Attach to container/service
  • Restart, delete, and rebuild containers/services
  • View the ancestor layer of the given image
  • Trim containers, images, or volumes that occupy disk space

Installing LazyDocker is also very simple, just run the following command. docker run –rm -it -v

/var/run/docker.sock:/var/run/docker.sock

-v ~/.config/lazydocker:/.config/jesseduffield/lazydocker

lazyteam/lazydocker ​

Of course, if you find LazyDocker useful and ready to use it more often, you can also abbreviate it and add it to your shell configuration file to turn it into a simple command. For example, if I’m using ZSH, add the following to the.zshrc file. You can now call LazyDocker directly from LZD.

echo “alias lzd=’docker run –rm -it -v /var/run/docker.sock:/var/run/docker.sock -v . ~ / config/lazydocker: / config/jesseduffield lazydocker lazyteam/lazydocker ‘” > > ~ /. ZSHRC then you can view the Docker container in terminal, mirroring and volumes of information. LazyDocker supports keyboard operation and mouse click. You can view the corresponding information by clicking the mouse directly

Docker Desktop

Docker Desktop is an official Docker client.Docs.docker.com/desktop/win…; If you are a Windows user and want to run docker container on Windows, you can use it.

summary

  • Portainer is better for teams because it has access control.
  • Lazydocker is a simple and flexible gadget. If you don’t need complicated features, they are suitable and will make you feel more like a programmer.
  • Docker Desktop is Windows/Mac Docker installation, the management function is relatively simple, in the need for a simple integration of Kubernetes can use him.