Convert Figma logo to code with AI

moncho logodry

dry - A Docker manager for the terminal @

2,954
98
2,954
36

Top Related Projects

The lazier way to manage everything docker

15,424

Top-like interface for container metrics

3,761

Immersive terminal interface for managing docker containers and services

1,908

Given an existing docker container, prints the command line necessary to run a copy of it.

45,415

A tool for exploring each layer in a docker image

26,263

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.

Quick Overview

Dry is a terminal application that provides a user-friendly interface for managing Docker containers, images, and networks. It offers an interactive command-line experience, allowing users to monitor and control Docker resources without the need for complex Docker CLI commands.

Pros

  • Intuitive and interactive terminal-based interface for Docker management
  • Real-time monitoring of container resources and logs
  • Easy navigation and control of Docker objects (containers, images, networks)
  • Keyboard shortcuts for quick actions and improved productivity

Cons

  • Limited to terminal environments, may not be suitable for users who prefer graphical interfaces
  • Requires some familiarity with Docker concepts and terminology
  • May not support all advanced Docker features or complex configurations
  • Dependent on the Docker daemon being running and accessible

Getting Started

To get started with Dry, follow these steps:

  1. Install Dry:

    curl -sSf https://moncho.github.io/dry/dryup.sh | sudo sh
    

    Or download the latest release from the GitHub releases page.

  2. Ensure Docker is running on your system.

  3. Run Dry:

    dry
    
  4. Use the arrow keys to navigate, press h for help, and q to quit.

  5. Explore containers, images, and networks using the interface.

  6. Use keyboard shortcuts (e.g., F1, F2, F3) to switch between different views.

For more detailed instructions and usage information, refer to the project's README and documentation on GitHub.

Competitor Comparisons

The lazier way to manage everything docker

Pros of lazydocker

  • More comprehensive feature set, including container logs, stats, and image management
  • Actively maintained with frequent updates and bug fixes
  • Better support for Docker Compose and Swarm

Cons of lazydocker

  • Steeper learning curve due to more complex interface
  • Requires more system resources to run

Code comparison

dry:

func (v *ContainerDetailsWidget) updateHeader() {
    v.header.Clear()
    v.header.AddText(v.container.Names[0], true, termui.AlignLeft, termui.ColorWhite)
    v.header.AddText(v.container.ID[:12], true, termui.AlignRight, termui.ColorWhite)
}

lazydocker:

func (gui *Gui) renderContainerHeader(container *commands.Container) string {
    return fmt.Sprintf(
        "%s %s %s %s",
        utils.ColoredString(container.Name, gui.Config.UserConfig.GUI.ContainerNameColor),
        utils.ColoredString(container.ID[:12], gui.Config.UserConfig.GUI.ContainerIdColor),
        utils.ColoredString(container.Status, gui.Config.UserConfig.GUI.ContainerStatusColor),
        utils.ColoredString(container.Image, gui.Config.UserConfig.GUI.ContainerImageColor),
    )
}

Both projects aim to provide terminal-based Docker management tools, but lazydocker offers a more feature-rich experience at the cost of increased complexity. dry focuses on simplicity and ease of use, making it a good choice for users who prefer a lightweight solution. The code comparison shows that lazydocker implements more customization options for its UI, while dry keeps things more straightforward.

15,424

Top-like interface for container metrics

Pros of ctop

  • More comprehensive resource usage metrics, including detailed CPU and memory stats
  • Supports multiple container runtimes beyond just Docker (e.g., rkt, LXC)
  • Offers a single-container view with real-time graphs

Cons of ctop

  • Less interactive functionality compared to dry (e.g., no container management)
  • May have higher resource overhead due to more detailed metrics collection
  • Limited customization options for the display layout

Code Comparison

dry:

func (v *ContainerDetailsWidget) updateHeader() {
    v.header.Clear()
    v.header.AddText(v.container.Name, true, termui.AlignLeft, termui.ColorWhite)
    v.header.AddText(v.container.ID, true, termui.AlignRight, termui.ColorWhite)
}

ctop:

func (cm *ContainerMetrics) CPUUtil() float64 {
    if cm.CPUUtil == nil {
        return 0
    }
    return *cm.CPUUtil
}

Both projects use Go and focus on container monitoring, but dry offers more interactive features while ctop provides more detailed metrics. The code snippets show different approaches: dry focuses on UI updates, while ctop emphasizes metric calculations.

3,761

Immersive terminal interface for managing docker containers and services

Pros of dockly

  • Built with Node.js, making it more accessible for JavaScript developers
  • Offers a plugin system for extending functionality
  • Provides a more colorful and visually appealing interface

Cons of dockly

  • Less mature project with fewer stars and contributors
  • May have performance limitations compared to Go-based alternatives
  • Lacks some advanced features present in dry, such as container logs tailing

Code comparison

dockly (JavaScript):

const blessed = require('blessed')
const contrib = require('blessed-contrib')
const screen = blessed.screen()
const grid = new contrib.grid({rows: 12, cols: 12, screen: screen})

dry (Go):

func (h *Handlers) ContainerList(w http.ResponseWriter, r *http.Request) {
    containers, err := h.client.ContainerList(context.Background(), types.ContainerListOptions{})
    if err != nil {
        http.Error(w, err.Error(), http.StatusInternalServerError)
        return
    }
}

Both projects aim to provide terminal-based Docker management interfaces, but they differ in implementation language and some features. dry is written in Go and offers a more comprehensive set of features, while dockly is built with Node.js and focuses on ease of use and extensibility through plugins.

1,908

Given an existing docker container, prints the command line necessary to run a copy of it.

Pros of runlike

  • Lightweight and focused on a single task: generating Docker run commands
  • Easy to use as a command-line tool or import as a Python module
  • Supports outputting commands for multiple containers at once

Cons of runlike

  • Less feature-rich compared to dry's interactive terminal interface
  • Limited to generating run commands, doesn't provide container management capabilities
  • Less actively maintained, with fewer recent updates

Code comparison

dry:

func (v *ContainerDetailsWidget) updateHeader() {
    header := NewHeader()
    header.Add("Name", v.container.Names[0])
    header.Add("ID", v.container.ID)
    header.Add("Image", v.container.Image)
    v.header = header
}

runlike:

def get_docker_run_cmd(container_id):
    container = client.containers.get(container_id)
    cmd = ['docker', 'run']
    cmd.extend(get_container_options(container))
    cmd.append(container.image.tags[0])
    return ' '.join(cmd)

Both projects aim to assist with Docker container management, but they take different approaches. dry provides a comprehensive terminal UI for monitoring and managing containers, while runlike focuses solely on generating Docker run commands. dry offers more features and is more actively maintained, making it suitable for users who want a full-featured container management tool. runlike, on the other hand, is ideal for those who need a simple way to recreate container run commands, either programmatically or via the command line.

45,415

A tool for exploring each layer in a docker image

Pros of dive

  • Provides a layer-by-layer analysis of Docker images, offering detailed insights into image composition
  • Allows for interactive exploration of image layers, making it easier to identify large or unnecessary files
  • Offers a content view for each layer, enabling users to inspect file changes between layers

Cons of dive

  • Focuses primarily on image analysis, lacking broader Docker management features
  • May have a steeper learning curve for users unfamiliar with Docker image internals
  • Limited to analyzing local images, not providing remote registry exploration capabilities

Code comparison

dive:

func analyzeImage(imageID string, refTrees []*filetree.FileTree) (*image.AnalysisResult, error) {
    analysis := &image.AnalysisResult{
        Layers: make([]*image.Layer, 0),
    }
    // ... (additional analysis logic)
}

dry:

func (d *Dry) refreshContainers() error {
    containers, err := d.dockerDaemon.Containers()
    if err != nil {
        return err
    }
    d.containerList = containers
    return nil
}

Summary

While dive excels in detailed Docker image analysis, dry offers a more comprehensive Docker management interface. dive provides in-depth layer exploration and file change tracking, making it ideal for optimizing image sizes. On the other hand, dry focuses on overall Docker container management, offering a broader set of features for monitoring and interacting with containers. The choice between the two depends on whether the user needs specialized image analysis (dive) or general Docker management capabilities (dry).

26,263

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.

Pros of Glances

  • More comprehensive system monitoring, covering CPU, memory, network, disk, and processes
  • Cross-platform support (Linux, macOS, Windows)
  • Extensible plugin system for additional metrics and integrations

Cons of Glances

  • Lacks Docker-specific features and container management capabilities
  • May be more resource-intensive due to its broader monitoring scope
  • Steeper learning curve for users primarily interested in Docker monitoring

Code Comparison

Glances (Python):

from glances_api import Glances

glances = Glances()
cpu_percent = glances.cpu.percent
print(f"CPU Usage: {cpu_percent}%")

Dry (Go):

package main

import "github.com/moncho/dry/appui"

func main() {
    stats := appui.NewDockerStats()
    cpuUsage := stats.CPUPercentage()
    fmt.Printf("CPU Usage: %.2f%%\n", cpuUsage)
}

Summary

Glances offers broader system monitoring capabilities and cross-platform support, making it suitable for general-purpose monitoring. However, it lacks Docker-specific features compared to Dry. Dry focuses on Docker container management and monitoring, providing a more specialized tool for Docker users. The code examples demonstrate the different approaches: Glances uses a Python API for general system metrics, while Dry utilizes Go for Docker-specific statistics.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

dry

MIT License Build Status Docker Build Go Report Card GoDoc Github All Releases Release dry

Dry is a terminal application to manage Docker and Docker Swarm.

It 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, it can be used to manage Docker. Most of the commands that the official Docker CLI provides, are available in dry with the same behaviour. A list of available commands and their keybindings can be found in dry's help screen or in this README.

Lastly, it can also be used as a monitoring tool for Docker containers.

Dry is installed as a single binary and does not require external libraries.

The demo below shows a dry session.

asciicast

dry keybinds

Global

KeybindingDescription
%filter list
F1sort list
F5refresh list
F7toggle showing Docker daemon information
F8show docker disk usage
F9show last 10 docker events
F10show docker info
1show container list
2show image list
3show network list
4show volumes list
5show node list (on Swarm mode)
6show service list (on Swarm mode)
7show stacks list (on Swarm mode)
ArrowUpmove the cursor one line up
ArrowDownmove the cursor one line down
gmove the cursor to the top
Gmove the cursor to the bottom
qquit dry

Container commands

KeybindingDescription
Entershow container command menu
F2toggle on/off showing stopped containers
iinspect
lcontainer logs
eremove
sstats
Ctrl+eremove all stopped containers
Ctrl+kkill
Ctrl+lcontainer logs with Docker timestamps
Ctrl+rstart/restart
Ctrl+tstop

Image commands

KeybindingDescription
ihistory
rrun command in new container
Ctrl+dremove dangling images
Ctrl+eremove image
Ctrl+fremove image (force)
Ctrl+uremove unused images
Enterinspect

Network commands

KeybindingDescription
Ctrl+eremove network
Enterinspect

Volume commands

KeybindingDescription
Ctrl+aremove all volumes
Ctrl+eremove volume
Ctrl+fremove volume (force)
Ctrl+uremove unused volumes
Enterinspect

Service commands

KeybindingDescription
iinspect service
lservice logs
Ctrl+lservice logs with Docker timestamps
Ctrl+rremove service
Ctrl+sscale service
Ctrl+uupdate service
Entershow service tasks

Moving around buffers

KeybindingDescription
ArrowUpmove the cursor one line up
ArrowDownmove the cursor one line down
gmove the cursor to the beginning of the buffer
Gmove the cursor to the end of the buffer
nafter search, move forwards to the next search hit
Nafter search, move backwards to the previous search hit
ssearch
pg upmove the cursor "screen size" lines up
pg downmove the cursor "screen size" lines down

Installation

The easiest way to install the latest binaries for Linux and Mac is to run this in a shell:

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

Binaries

If you dont like to curl | sh, binaries are provided.

Mac OS X / Homebrew

If you're on OS X and want to use homebrew:

brew tap moncho/dry
brew install dry

Docker

docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_HOST=$DOCKER_HOST moncho/dry

Arch Linux

yaourt -S dry-bin

Usage

Open a console, type dry. It will try to connect to:

  • A Docker host given as a parameter (-H).
  • if none given, a Docker host defined in the $DOCKER_HOST environment variable.
  • if not defined, to unix:///var/run/docker.sock.

If no connection with a Docker host succeeds, dry will exit.

dry -p launches dry with pprof package active.

Contributing

All contributions are welcome.

  • Fork the project.
  • Make changes on a topic branch.
  • Pull request.

Copyright and license

Code released under the MIT license. See LICENSE for the full license text.

Credits

Built on top of:

Alternatives

See Awesome Docker list for similar tools to work with Docker.