Lazydocker - GUI for Docker directly in the terminal
Two years ago, we already did a review of the GUI interfaces for working with Docker, but the world of fans of such solutions does not stand still. The other day, version 0.2 was updated, and at the same time it received wide publicity, the young project lazydocker , positioning itself as "a more lazy way to manage everything in Docker." The utility is rapidly gaining popularity - just yesterday the number of its GitHub stars did not reach 3000, and today it has exceeded 4000.
Opportunities
The authors of lazydocker explain the appearance of their brainchild in this way:
“Memorizing teams is docker
hard. Memorizing aliases is a little less difficult. It is almost impossible to monitor the condition of containers through the numerous windows of the terminal. But what if all the required information would be in one window, and each typical command is accessible by pressing one key (and it was possible to add your own commands)? Lazydocker's goal is to make this dream a reality. ”
So, lazydocker makes the terminal an interactive interface for Docker and Docker Compose, which allows you to quickly and conveniently switch between services running in different containers and related resources (images, volumes), view their status and execute various commands. Since “sometimes it’s better to see it once”, the authors took care of a very self-sufficient gif-illustration:
Navigation on the interface is supported both with the keyboard and the mouse. When you select the desired item, a context menu is available for it:
Example of a context menu for the selected container.
As you can see, each command also has a predefined key for quickly performing popular actions. A complete list of them can be seen here (by the way, the menu has localizationsfor several languages, among which there is still no Russian).
Special attention deserves the attention paid to viewing the status of containers: here not only the output of logs and config, but also graphically displayed statistics (by default, this is CPU / memory consumption), and top processes. These capabilities apply to arbitrary metrics, for graphical viewing of which graphs are also configured (see section
stats
in the config ). For the selected images, you can see the commands executed at their launch from
Dockerfile
, the inherited layers. Cleaning of unused containers, images, volumes ( prune
) is provided . Available commands can be modified, as well as supplemented with your own. How to do this is easy to see in blocks
commandTemplates
andcustomCommands
config (by the way, the same configuration can be edited directly from the utility itself):commandTemplates:
dockerCompose: docker-compose
restartService: '{{ .DockerCompose }} restart {{ .Service.Name }}'
stopService: '{{ .DockerCompose }} stop {{ .Service.Name }}'
…
customCommands:
containers:
- name: bash
attach: true
command: docker exec -it {{ .Container.ID }} /bin/sh
serviceNames: []
…
Installation
Lazydocker is written in Go using the gocui library , designed to create console interfaces. Requires Go version 1.12. The source code is distributed under the free BSD 3-Clause (New) license.
Installation boils down to a simple command:
go get github.com/jesseduffield/lazydocker
The rest is easier to try and see for yourself.
Prospects
The development of lazydocker has so far been predominantly carried out by one person, but "fresh blood" in the face of the wider community has brought its popularity. For example, now we are discussing PRs initiated less than a day ago by a redesigned Dockerfile and a simplified installation of a binary utility release in Linux distributions.
In the issues of the project, you can see such requests for improvements as custom keybindings and team support
docker stack
. Again, they appeared less than a day ago. All this suggests that in the near future we can expect lazydocker to mature to a more functional and convenient solution, for which the Docker community has appeared a clear demand.
PS
Read also in our blog: