A few days ago, we published a guide which covered almost all details you ever need to know to getting started with Docker. In that guide, we have shown you how to create and manage Docker containers in detail. There are also some non-official tools available for managing Docker containers. If you've looked at our old archives, you might have stumbled upon two web-based tools namely "Portainer" and "PiCluster". Both of them makes the Docker management task much easier and simpler from a web browser. Today, I came across yet another Docker management tool named "Dockly".
Unlike the aforementioned tools, Dockly is a TUI (text user interface) utility to manage Docker containers and services from the Terminal in Unix-like systems. It is free, open source tool built with NodeJS. In this brief guide, we will see how to install Dockly and how to manage Docker containers from command line.
Make sure you have installed NodeJS on your Linux box. If you haven't installed it yet, refer the following guide.
Once NodeJS is installed, run the following command to install Dockly:
# npm install -g dockly
Manage Docker Containers With Dockly From Terminal
Managing Docker containers with Dockly is easy! All you have to do is to open the terminal and run the following command:
Dockly will will automatically connect to your localhost docker daemon through the unix socket and display the list of running containers in the Terminal as shown below.
As you can see in the above screenshot, Dockly displays the following information of running containers on the top:
- Container ID,
- Name of the container(s),
- Docker image,
- State of the running container(s),
On the top right side, you will see the CPU an Memory utilization of containers. Use UP/DOWN arrow keys to move between Containers.
At the bottom, there are few keyboard shortcut keys to do various docker management tasks. Here are the list of currently available keyboard shortcuts:
- = - Refresh the Dockly interface,
- / - Search the containers list view,
- i - Display the information about the currently selected container or service,
- <RETURN> - Show logs of the current container or service,
- v - Toggle between Containers and Services view,
- l - Launch a /bin/bash session on the selected Container,
- r - Restart the selected Container,
- s - Stop the selected Container,
- h - Show HELP window,
- q - Quit Dockly.
Viewing information of a container
Choose a Container using UP/DOWN arrow and press "i" to display the information of the selected Container.
If you want to restart your Containers at any time, just choose it and press "r" to restart.
Stop/Remove Containers and Images
We can stop and/or remove one or all containers at once if they are no longer required. To do so, press "m" to open Menu.
From here, you can do the following operations.
- Stop all Docker containers,
- Remove selected container,
- Remove all containers,
- Remove all Docker images etc.
Display Dockly help section
If you have any questions, just press "h" to open the help section.
For more details, refer the official GitHub page given at the end.
And, that's all for now. Hope this was useful. If you spend a lot of time working with Docker containers, give Dockly a try and see if it helps.
- How To Automatically Update Running Docker Containers
- ctop – A Commandline Monitoring Tool For Linux Containers