There are some great tools that make Docker easier to use. We covered the web-based Portainer CE in the previous article in this series.
But what if you want an easy way to manage Docker from the terminal? Dry is a terminal application to manage Docker and Docker Swarm.
Dry shows information about containers, images and networks, and, if running a Swarm cluster, it shows information about nodes, service, stacks and the rest of Swarm constructs. It can be used with both local or remote Docker daemons.
Besides showing information, Dry can be used to manage Docker. Most of the commands that the official Docker CLI provides are available in Dry with the same behaviour.
Installation
Installing Dry is very simple. Download the dryup.sh shell script from the project’s GitHub repository. Issue the command:
$ curl -sSf https://moncho.github.io/dry/dryup.sh | sudo sh
All that’s now required is to make the dry file executable, with the command:
$ sudo chmod 755 /usr/local/bin/dry
We can also run the program with docker. Issue the command:
$ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_HOST=$DOCKER_HOST moncho/dry
In Operation
On startup Dry shows the containers that are running. In the image below we are showing all containers (this is toggled using the F2 key).
The program lets us list and manage containers, images, networks, volumes, nodes, services, and stacks. There’s sorting functionality (accessed by pressing F1) as well as filtering functionality.
Stacks can be removed with Dry. Removing a stack removes all the services, networks, configs and secrets that were created when the stack was created.
When viewing the containers, we can fetch the logs, inspect, kill and remove containers. The logs show docker timestamps. There’s also image history, stats, and much more all available at a single key press.
Dry can connect via ssh to a remote docker node.
Like any CLI program, you’ll definitely want to learn the keyboard shortcuts. Press H when running the program to list them. There’s Vim and Emacs-style keybindings for scrolling up and down.
Next page: Page 2 – Monitoring / Summary
Pages in this article:
Page 1 – Installation / In Operation
Page 2 – Monitoring / Summary
All articles in this series:
Getting Started with Docker | |
---|---|
Installing Docker Engine | Let's start with the basics. We install Docker Engine on Ubuntu |
Run Docker without sudo | Run Docker without the security privileges of root |
Commands | A brief overview of the 40 Docker commands |
Images | A Docker image is a file used to execute code in a Docker container |
Portainer CE | Install this interface to manage different Docker environments |
Dry | Interactive CLI for Docker containers |
Docker seems so complicated with a whole new vocab.