paint-brush
DRY — an Alternate Command Line Tool for Dockerby@abdulkarim_78118
5,105 reads
5,105 reads

DRY — an Alternate Command Line Tool for Docker

by KarimMay 31st, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

<a href="https://moncho.github.io/dry/" target="_blank">Dry</a> is a terminal application to manage <a href="https://hackernoon.com/tagged/docker" target="_blank">Docker</a> containers and images. It aims to be an alternative to the official Docker CLI when it is needed to repeatedly execute commands on existing containers and images, and also as a tool to monitor Docker containers from a terminal. You can think of Dry as htop for containers.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - DRY — an Alternate Command Line Tool for Docker
Karim HackerNoon profile picture

Comparison of dry versus docker cli.

Dry is a terminal application to manage Docker containers and images. It aims to be an alternative to the official Docker CLI when it is needed to repeatedly execute commands on existing containers and images, and also as a tool to monitor Docker containers from a terminal. You can think of Dry as htop for containers.

Installation

## LINUX$ curl -sSf https://moncho.github.io/dry/dryup.sh | sudo sh$ sudo chmod 755 /usr/local/bin/dry


## MACbrew tap moncho/dry brew install dry

Usage

$ dry

This will open up a prompt loaded with all the useful information about the docker daemon and the containers that are running. It can connect to local or remote docker host. In this example we are connected to local daemon (unix:///var/run/docker.sock).

top: dry | bottom: docker ps

This image shows a comparison between docker ps and dry. The dry experience is definitely much better than the default docker cli.

monitor

You can enter the monitor mode in dry by pressing m key. This is equivalent to docker stats command. Let’s see how the monitoring compares between the two

top: dry | bottom: docker stats

Both the tools provide similar metrics but again dry has more verbose and colored output. It also has an additional NAME column which comes handy at times when you have many containers you are not a memory champion.

containers

If you select a container from the main menu you get a list of operations that can be performed.

` dry: containers

You can view logs, inspect, kill and do a bunch of other things to the container. The Stats+Top is a useful feature that shows the resource utilization and output of top from the container.

dry: Stats + Top

The docker cli flow would be to first fetch the container id from docker ps and then execute top interactively inside the container docker exec -it <container_id> top.

images

You can operate on images by pressing 2 inside the main menu.

dry: images

If you want to remove an image simply select it from the menu and press Ctrl + E. For force removal you must use Ctrl + F.

help

To get help on dry commands you can start dry and press H key or visit their github page.

Dry may not add a lot of value for everyone but it is definitely some sugar on top of vanilla docker cli. I use this tool a lot and would recommend others to give it a try.

❤ If this post was helpful, please hit the little green heart!