Giter VIP home page Giter VIP logo

dry's Introduction

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

Keybinding Description
% filter list
F1 sort list
F5 refresh list
F7 toggle showing Docker daemon information
F8 show docker disk usage
F9 show last 10 docker events
F10 show docker info
1 show container list
2 show image list
3 show network list
4 show volumes list
5 show node list (on Swarm mode)
6 show service list (on Swarm mode)
7 show stacks list (on Swarm mode)
ArrowUp move the cursor one line up
ArrowDown move the cursor one line down
g move the cursor to the top
G move the cursor to the bottom
q quit dry

Container commands

Keybinding Description
Enter show container command menu
F2 toggle on/off showing stopped containers
i inspect
l container logs
e remove
s stats
Ctrl+e remove all stopped containers
Ctrl+k kill
Ctrl+l container logs with Docker timestamps
Ctrl+r start/restart
Ctrl+t stop

Image commands

Keybinding Description
i history
r run command in new container
Ctrl+d remove dangling images
Ctrl+e remove image
Ctrl+f remove image (force)
Ctrl+u remove unused images
Enter inspect

Network commands

Keybinding Description
Ctrl+e remove network
Enter inspect

Volume commands

Keybinding Description
Ctrl+a remove all volumes
Ctrl+e remove volume
Ctrl+f remove volume (force)
Ctrl+u remove unused volumes
Enter inspect

Service commands

Keybinding Description
i inspect service
l service logs
Ctrl+l service logs with Docker timestamps
Ctrl+r remove service
Ctrl+s scale service
Ctrl+u update service
Enter show service tasks

Moving around buffers

Keybinding Description
ArrowUp move the cursor one line up
ArrowDown move the cursor one line down
g move the cursor to the beginning of the buffer
G move the cursor to the end of the buffer
n after search, move forwards to the next search hit
N after search, move backwards to the previous search hit
s search
pg up move the cursor "screen size" lines up
pg down move 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.

dry's People

Contributors

bard avatar bitdeli-chef avatar codelingobot avatar dependabot[bot] avatar fpiesche avatar gangefors avatar gitter-badger avatar hako avatar itwars avatar jauderho avatar marknbroadhead avatar moncho avatar muesli avatar n33wb avatar nooproblem avatar pekovac avatar slomek avatar stokito avatar tbocek avatar testwill avatar thetechoddbug avatar tshepang avatar vsobotka avatar xmirakulix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dry's Issues

Feature Request: Make columns selectable

Hey,
great tool and great work ๐Ÿ‘ Please see this issue as constructive critisicm, It also may relate to #14. I just took this screenshot:

screenshot

And I have the following "problems" with it (and a solution for all of them below):

  1. Problem: We use a custom registry, a lot of the name gets cut down to ...

    Potential Solution: Let the user specify a regex (or string) which could be replaced: docker-registry.example.org/example-app:feature_branch โžก๏ธ deo/example-app:feature_branch

  2. Problem: The health status is invisible most of the times

    Potential Solution: Replace Up with an arrow up โฌ†๏ธ and more importantly, convert the human readable times to shorter ones, e.g. Up 16 minutes โžก๏ธ โ†‘ 16m, Exited (137) Less than a second agoโžก๏ธ Exited (137) < 1s ago and Up About a minute (health: starting) โžก๏ธ โ†‘~1m (starting)

  3. Problem: We do use docker-compose. Unless I am not debugging docker-compose, I do not care about the Command and Ports. Not showing them would give me a lot of space and less cluttered UI.

The potential solutions for 1. and 2. can probably ignored if shown columns are selectable.

Content of lines longer than the terminal width is not shown

dry does not render the final part of lines whose content is longer than the terminal width.

An example, if the terminal width is 10, for this log line:
The sun is shining
dry will just render:
The sun is

Fix it, so it renders the part of a line that does not fit in the terminal screen in a new line. Using the example above:

The sun is 
 shinning

Broken output rendering

See attached screenshot, the layout is all mutilated and I get a bunch of question marks "๏ฟฝ"

Using:
OS: OpenSUSE TumbleWeed
Gnome: 3.26.1
Docker: version 17.09.1-ce, build f4ffd2511ce9

image

Color scheme on Windows

Hello,
Thank you for this great tool.
I 'm trying to use it on Windows 10 Pro.
It starts correctly but color theme is horrible. Text with the same color of background.
Is it possible to change color scheme (config file, ...)?

Bye

Connection via TLS is not using default values

When the environment variable DOCKER_TLS_VERIFY is set to 1, docker client , by default, expects to find docker-service certificates inside ~/.docker folder.
Looks like dry ALSO expects a variable called DOCKER_CERT_PATH pointing to this folder.

From my point of view, there's two solutions :

  1. Throw an error if DOCKER_TLS_VERIFY exists but there's no DOCKER_CERT_PATH variable
  2. Search first inside ~/.docker folder to find certificates, and it there's none, throw an error about DOCKER_CERT_PATH not telling where they are. This is the one i like the most.

ARM binaries?

Would be nice to provide ARM binaries for devices like the Raspberry Pi 2 & Raspberry Pi Model B+. I had to install Go on B+ just to go get the binary. (Great job btw @moncho with dry)

rendering time is useless?

Hi,

I think it's useless to display time in the ui, because the container is UTC, so the display time is wrong for most users?

render.go line 198.

or to make it great for everyone just add following steps in Dockerfile:

# Add your own correct timezone!
RUN apk add tzdata && \
        cp /usr/share/zoneinfo/Europe/Paris /etc/localtime && \
        echo "Europe/Paris" >  /etc/timezone && \
        apk del tzdata

BR
Vincent

killed containers do not disappear from list

dry version 0.3-beta.9, build e0c03ae

Issue: killed containers do not disappear from list immediately, but show as exited when checked with an external tool.

To reproduce:

  • launch dry
  • K to kill a container
  • See text "killed container with id f00..."
  • container stays in the list of running containers for 30 seconds to 1 minute

I was expecting it to drop from the list like in 0.3-beta.6

Thanks.

Update container information asynchronously

Using dry to connect to a remote Docker Engine might result in screen flickering.

It happens because every action done in dry results in a call to the remote Engine to retrieve the list of containers. Flickering is not so obvious using a local Engine (sockets are fast), but network speed affects dry responsiveness and rendering when connected to a remote Engine.

Change dry so it listens asynchronously for events from the Docker Engine to know when to update container information.

Feature Request: Scale services

On the services screen, add the option to scale the selected service.

A modal asking for the number of replicas should be shown, if a valid number is provided, the selected service will be scaled accordingly.

Keybinding: Ctrl+s

Documentation: tls parameters

I saw the remote host related parameters in the help. Our remote docker command looks like this:

docker --tlsverify --tlscacert=~/.supersecret/ca.pem --tlscert=~/.supersecret/client-cert.pem --tlskey=~/.supersecret/client-key.pem  -H=docker.example.org:1234

How would I start dry with those parameters?

Thanks :)

Feature request: Toggle "follow" on "Fetch logs" view

Thank you for this great tool!

Would be nice to have the ability to follow logs in the container's "Fetch logs" view. Currently I need to get out and back to that view (and hit G) to see newer logs, which combined with #42 makes the process pretty cumbersome.

Invalid memory address or nil pointer dereference on some Container

Just tried out the latest version and on Stats+Top I got:

panic: runtime error: invalid memory address or nil pointer dereference                                                ID:             4be8a0e849e5  Status:  Up 11 days                                                                
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xa94826]
goroutine 114 [running]:
github.com/moncho/dry/appui.(*ContainerStatsRow).Update(0xc420086780, 0xc420319560, 0x0)
 IP Ad/opt/gocode/src/github.com/moncho/dry/appui/stats_row.go:148 +0x26  
github.com/moncho/dry/app.statsScreen(0xc420319560, 0xc42000a160, 0xc4203a25c0, 0xc420075500, 0xc4201dc010)
        /opt/gocode/src/github.com/moncho/dry/app/container_events.go:378 +0x3df      
created by github.com/moncho/dry/app.(*cMenuEventHandler).handleCommand              
        /opt/gocode/src/github.com/moncho/dry/app/cmenu_events.go:139 +0x650    

This repeatedly happens on the Portianer Instance. However not all containers are affected.

Unable to build a project

Hi, I wanted to jump in this project, play with it a bit and learn some go while solving some issues in the process. Unfortunately, I am not able to build this project and as I am new to Go and its ecosystem, I could use some help, if you would.

I have Go installed. I have cloned this repo to $GOPATH/src, but when I try to download dependencies with dep ensure, I get ths error:

Solving failure: No versions of github.com/docker/docker met constraints:
	d58ffa0364c04d03a8f25704d7f0489ee6cd9634: Could not introduce github.com/docker/docker@d58ffa0364c04d03a8f25704d7f0489ee6cd9634 due to a case-only variation: it depends on "github.com/Sirupsen/logrus", but "github.com/sirupsen/logrus" was already established as the case variant for that project root by the following other dependers:
	(root)
(6)	? attempt github.com/docker/docker with 14 pkgs; at least 1 versions to try
(6)	    try github.com/docker/docker@d58ffa0364c04d03a8f25704d7f0489ee6cd9634
(7)	โœ—   case-only variation in dependency on "github.com/Sirupsen/logrus"; "github.com/sirupsen/logrus" already established by:
(7)	  (root)
(7)	  github.com/docker/cli@master
(6)	    try github.com/docker/[email protected]
(7)	โœ—   github.com/docker/[email protected] not allowed by constraint d58ffa0364c04d03a8f25704d7f0489ee6cd9634:
(7)	    d58ffa0364c04d03a8f25704d7f0489ee6cd9634 from (root)
(6)	    try github.com/docker/[email protected]

make vendor does not help either as it runs dep ensure before the sed. Running the sed manually does not help.

I am running Ubuntu 18.04.

I tried to solve it last three days with no success. What am I missing? I tried to find the uppercase Sirupsen package in the dependencies, but I did not find it anywhere.

Thanks for your help. I can't wait to get it working and do some PRs.

Feature Request: Connect to container

Awesome work!
It would be great, if i select a container, if i could say connect to container (docker exec -it sh, that's the only thing missing for me

Highlight entire row when listing containers

It would be helpful, especially in monitor mode, if the entire row was highlighted when using cursor to select a container. Keep find myself tracing along the line to see how much RAM/NET/IO a container is using.

Windows Instructions

I'd like to test this out on Windows but not sure how to proceed after downloading the binary.

Timeout while trying to connect to Docker Daemon

I'm getting a timeout while trying to connect to docker daemon. I'm running with my user which is part of "docker" group and does not requires sudo to access the docker socket. I've tried as root as well.

I only could get it to work using version 0.3-beta.1, build 3816d77. So I believe it may be a bug at stop showing loading screen as it does not seems to be a connection problem.

screenshot from 2017-11-08 10-41-39

Request: Homebrew Recipe

This is an incredible tool, thank you for creating it!

When you have time, would you be open to using goreleaser to upload recipes to homebrew? I assume you're using some automated release flow, so hopefully this isn't too much effort.

Thanks so much. Loving the feature set and speed.

Problem to run

$ dry
INFO[0000] Launching dry
ERRO[0000] There was an error launching dry              error="Error retrieving container list: Error response from daemon: client is newer than server (client API version: 1.30, server API version: 1.24)"
INFO[0000] Bye

The official client rules well and I have the same version in client and server

$ docker version
Client:
 Version:      17.05.0-ce
 API version:  1.24 (downgraded from 1.29)
 Go version:   go1.8.1
 Git commit:   89658be
 Built:
 OS/Arch:      darwin/amd64

Server:
 Version:      1.12.1
 API version:  1.24 (minimum version )
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 17:52:38 2016
 OS/Arch:      linux/amd64
 Experimental: false

Opening Dry in monitor mode crashes

If I open dry directly into monitor mode (dry -m) it panics and crashes:

INFO[0000] Launching dry                                
ERRO[0000] Dry panicked                                  error="runtime error: invalid memory address or nil pointer dereference"
INFO[0000] Bye

However if I run dry and then switch to monitor mode it works.

Running v0.8-beta.4 (64-bit) on Ubuntu 16.04, this wasn't present on 0.8-beta.3. Let me know if you need any more information.

Typo in help screen

There's a typo in the dry help screen that is invoked using [H], the Ctrl+c binding reads "Quits dry inmediately", it should be "immediately".

This is in the latest version, 0.4-beta.4

Add more colors

something like this

spectacle hm8460

white background for the selected container/image
green for running container
red for stopped one
and maybe an orange one for a starting/stopping container.

Memory usage is misleading

There was a long-standing bug in Docker stats util (moby/moby#10824), which included caches into the memory usage reporting. While it was fixed recently in Docker 17.06 (docker/cli#80), dry is still affected by the issue.

I think it is worth porting the new way of memory usage reporting from the docker/cli#80.

Custom key bindings

It would be great to have a way to customize keys, Vim bindings are missed.

Feature Request: Remove services

On the services screen, add the option to remove the selected service.

A modal asking for confirmation should be shown before proceeding with the removal.

Keybinding: Ctrl+r

Docker 1.11+ dry not working using unix socket

hy,

been trying to use dry with docker 1.11 (using libcontainerd) but it failed starting as dry searches for a unix socket in unix:///var/run/docker.sock.

docker socket now is located at : /var/run/docker/libcontainerd/docker-containerd.sock

any idea how to fix ?

Container list does not show names if terminal width is too narrow

As container names help (a lot) to identify which container I'm working with, not seeing them as they come last and my terminal is too narrow is a problem.

Could it be possible to ;

  • Show the names before the container id (I never understood why this comes first in docker ps as it has no informational value to me)
  • Have the left and right arrow keys bound to move the buffer just like ps | less -S would allow

Very nice interface though, like it a lot.

Feature Request: Persist state before exit

There are several potential things one could want to jump back to after restarting dry.

  • Sorting of columns, I really like the sorting by status instead of container hash.
  • Activated columns (if #48 gets implemented)
  • Last screen, like monitor mode vs containers.

Maybe instead of persisting these could also be just commandline parameters, so that I can alias dry as I like it (maybe someone wants to start multiple drys with predefined settings)

Problem with image name and tag with private registry

When you get the images from the host, if there are private registry images, the tag is wrong, for example:
centos 7 eb98cdc284d4 4 weeks ago 196.6 MB
exampleserver.net 5000/repo/image 3864bb8ecc3d 3 weeks ago 725 MB

The first is fine, but the second, you can't see the tag.

Kind regards.

Feature request: docker exec

Hey, @moncho...

Terrific work. This tool performs basic container operations very well for me, on both OS X and linux.

Would it be difficult to add the ability to run a command inside the selected container, with docker exec, and to display the resulting STDOUT/STDERR?

How about if that command were something fully-interactive, like /bin/bash? Could you start an interactive session, and then return to the previous dry screen on exit?

If this latter feature were in place, I'd consider using dry binary as an "unprivileged" $SHELL in /etc/passwd on the docker host. Users set up that way would then be able to fully manage containers, but not the host.

add enter/k key behavior like on htop

Make the enter key show the inspection is not much helpful. If you could trigger with the enter key an right or left menu with the list of commands that are now showed horizontally on the bottom would be more productive.

Rebind i to trigger inspections makes more sense and bind k to stop container would be more fun :)

Besides that everything is perfect ;)

Monitor mode + Help = Display issues

After launching Dry and beginning to explore some of it's features, I noticed that when in Monitor Mode and then bringing up the help menu there is a small display glitch.

Steps to repeat:

  1. Launch Dry
  2. Enter Monitor mode
  3. Press 'h' to enter the help menu

drymonitorissue

No way to set `--tlsverify=false` ?

I ran into an issue with one set of hosts I have. They have TLS certs but because the hosts have no DNS names (they're created in an AWS autoscale group), but always use the same TLS files, I can only use them with --tlsverify=false. Here's an example with the docker client:

    $ docker -H tcp://10.7.29.178:2376 --tls --tlscacert=$HOME/.docker/certs/ca.pem --tlscert=$HOME/.docker/certs/cert.pem --tlskey=$HOME/.docker/certs/key.pem --tlsverify=true version
    Client:
     Version:      1.9.1
     API version:  1.21
     Go version:   go1.4.3
     Git commit:   a34a1d5
     Built:        Fri Nov 20 17:56:04 UTC 2015
     OS/Arch:      darwin/amd64
    An error occurred trying to connect: Get https://10.7.29.178:2376/v1.21/version: x509: cannot validate certificate for 10.7.29.178 because it doesn't contain any IP SANs

And with --tlsverify=true:

    $ docker -H tcp://10.7.29.178:2376 --tls --tlscacert=$HOME/.docker/certs/ca.pem --tlscert=$HOME/.docker/certs/cert.pem --tlskey=$HOME/.docker/certs/key.pem --tlsverify=false version
    Client:
     Version:      1.9.1
     API version:  1.21
     Go version:   go1.4.3
     Git commit:   a34a1d5
     Built:        Fri Nov 20 17:56:04 UTC 2015
     OS/Arch:      darwin/amd64

    Server:
     Version:      1.9.0
     API version:  1.21
     Go version:   go1.4.2
     Git commit:   76d6bc9
     Built:        Tue Nov  3 17:43:42 UTC 2015
     OS/Arch:      linux/amd64

And there doesn't seem to be a way to mimic this with dry. Here are some variants I tried:

    $ dry -H tcp://10.7.29.178:2376 -c $HOME/.docker/certs
    INFO[0000] Launching dry
    ERRO[0000] There was an error launching dry: Get http://10.7.29.178:2376/version: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
    INFO[0000] Bye
    $ DOCKER_HOST=tcp://10.7.29.178:2376 DOCKER_CERT_PATH=~/.docker/certs DOCKER_TLS_VERIFY= dry
    INFO[0000] Launching dry
    ERRO[0000] There was an error launching dry: Get http://10.7.29.178:2376/containers/json: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
    INFO[0000] Bye
    $ dry -H tcp://10.7.29.178:2376 -c $HOME/.docker/certs -t
    INFO[0000] Launching dry
    ERRO[0000] There was an error launching dry: Get https://10.7.29.178:2376/version: x509: cannot validate certificate for 10.7.29.178 because it doesn't contain any IP SANs
    INFO[0000] Bye

You can see the last version has the same error as when --tlsverify is enabled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.