Code Monkey home page Code Monkey logo

docui's Introduction

docui - TUI Client for Docker Written in Go

Go Report Card CircleCI CircleCI GitHub All Releases GitHub commits

This repository is no longer maintenance. Please use lazydocker instead.

About docui

demo

docui is a TUI Client for Docker. It can do the following:

  • image

    • search/pull/remove
    • save/import/load
    • inspect/filtering
  • container

    • create/remove
    • start/stop/kill
    • export/commit
    • inspect/rename/filtering
    • exec cmd
  • volume

    • create/remove
    • inspect/filtering
  • network

    • remove
    • inspect/filtering

Supported OSes

  • Mac
  • Linux

Required Tools

  • Go Ver.1.11.4~
  • Docker Engine Ver.18.06.1~
  • Git

Installation

Environment variables

The following environment variables must be set.

export LC_CTYPE=en_US.UTF-8
export TERM=xterm-256color

From Source

If you have not installed go and set GOPATH/GOBIN, you must install and set env before installing docui.

This project uses Go Modules for dependencies introduced in Go 1.11.

Use go get or git clone:

$ go get -d github.com/skanehira/docui
$ cd $GOPATH/src/github.com/skanehira/docui
$ GO111MODULE=on go install
$ git clone https://github.com/skanehira/docui.git
$ cd docui/
$ GO111MODULE=on go install

Make sure your PATH includes the $GOPATH/bin directory so your commands can be easily used:

export PATH=$PATH:$GOPATH/bin

Homebrew

$ brew install docui

Nix

docui is available on nixpkgs unstable channel:

$ nix-env -i docui

Update

Use git pull:

$ git pull
$ GO111MODULE=on go install

Log file

Check wiki.

Use on Docker

$ docker run --rm -itv /var/run/docker.sock:/var/run/docker.sock skanehira/docui

Build Docker Image

$ make docker-build

Keybindings

panel operation key
all change panel Tab / Shift + Tab
all quit q
list panels next entry j /
list panels previous entry k /
list panels next page Ctrl / f
list panels previous page Ctrl / b
list panels scroll to top g
list panels scroll to bottom G
image list pull image p
image list search images f
image list remove image d
image list create container c
image list inspect image Enter
image list save image s
image list import image i
image list load image Ctrl + l
image list refresh image list Ctrl + r
image list filter image /
container list inspect container Enter
container list remove container d
container list start container u
container list stop container s
container list kill container Ctrl + k
container list export container e
container list commit container c
container list rename container r
container list refresh container list Ctrl + r
container list filter image /
container list exec container cmd Ctrl + e
container logs show container logs Ctrl + l
volume list create volume c
volume list remove volume d
volume list inspect volume Enter
volume list refresh volume list Ctrl + r
volume list filter volume /
network list inspect network Enter
network list remove network d
network list filter network /
pull image pull image Enter
pull image close panel Esc
create container next input box Tab
create container previous input box Shift + Tab
detail cursor dwon j
detail cursor up k
detail next page Ctrl / f
detail previous page Ctrl / b
search images search image Enter
search images close panel Esc
search result next image j
search result previous image k
search result pull image Enter
search result close panel q
create volume close panel Esc
create volume next input box Tab
create volume previous input box Shift + Tab

How to use

For details of the input panel please refer to wiki

Alternatives

  • lazydocker A simple terminal UI for both docker and docker-compose, written in Go with the gocui library.
  • docker.vim Manage docker containers and images in Vim
  • See Awesome Docker list for similar tools to work with Docker.

docui's People

Contributors

andriusm avatar arwtyxouymz avatar d-kuro avatar dawidd6 avatar friendbear avatar gotchane avatar inductor avatar komisan19 avatar kuuote avatar leica19 avatar lhanson avatar mattn avatar nozomi1773 avatar saromanov avatar skanehira avatar stephengroat avatar stokito avatar tetymd avatar yamash723 avatar zachvalenta 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

docui's Issues

compilation errors (syscall) on windows 10 64 bit

go version go1.12beta2 windows/amd64

github.com/skanehira/docui/common

common\common.go:175:27: not enough arguments in call to syscall.Syscall
common\common.go:175:28: undefined: syscall.SYS_IOCTL
common\common.go:176:15: undefined: syscall.TIOCGWINSZ
common\common.go:190:26: undefined: syscall.SIGWINCH
common\common.go:203:9: undefined: syscall.SIGWINCH

Problem about Super User Permission.

Hi :)

When I install docui and try to run, docui panics because of "Permission denied" from docker daemon.
So, I try sudo docui then docui not found.

env

Distro: Ubuntu18.04
docker: 18.09.5

The problem is permission.

  • In Ubuntu(maybe all linux distro), as a default, root permission or belonging docker group are needed when accessing docker daemon.
  • However, $GOPATH is local variable of login user, not root.

There are some solutions but which should we recommend?

  • Install docui locally and set env_keep PATH and run docui as root.
  • add login user docker group. (It may not be recommended)
  • install docui as root.
  • others

Thanks.

Doesn't correctly work in Ubuntu18.04

Hi
I'm really impressed your project and I want to use it.
But it doesn't correctly work in Ubuntu18.04.

Summary

  • Doesn't launch in tmux
  • Startup in normal shell, but UI is collapsed
  • Using docker, everything work

Doesn't launch in tmux

If i'm using tmux, docui doesn't launch with no error.
I checked $HOME/docui.log, there is no log.
This is preview.
docui_tmux

Startup in normal shell, but UI is collapsed

If i use normal shell (not tmux), docui command launch application.
However, UI is something wrong.
Please look at this gif
docui_normal

I'm so sorry the character is too small.
Some vertical black lines are displayed and they hide important characters like 'I' of 'ID' in header.

Using docker, everything work

If i use dockerized docui, everything work fine.
UI is correct, and if i used tmux, it's fine.
docui_docker

My Environment

  • OS: Ubuntu 18.04.3 LTS
  • docker: Docker version 19.03.1, build 74b1e89
  • docui: bd2021d6e1b6da00ca7b842679648d577bac0c53

Docker endpoint should be able to be overwritten by argument/environment variable

Currently, the docker endpoint is hard-coded and cannot be changed

https://github.com/skanehira/docui/blob/master/docker/docker.go#L14

However, several users use Docker on a remote host and may be find hard to use this tool on such an environment.

Suggestion:

  • Make the const be able to overwritten by an argument like docui --endpoint https://x.x.x.x:xxxx
  • Using DOCKER_HOST is preferable when the argument is not specified.
  • UNIX socket, HTTPS(TLS), SSH should be supported as Docker supports those.

Add Makefile template

Usage

  • make
    make clean && make build => create binary

  • make install
    cp binary $GOPATH/bin

  • make clean
    rm binary

  • make docker-build
    docker build -t hoge/huga .

  • make docker-push

  • make build-linux
    Notimplemented

Add show version feature

For troubleshooting purpose, it should be possible to get which version of Docker and docui you are using in your environment more easily.

  • docui -v, docui --version or docui version should show the version of docui and Docker that you're using.

  • Displaying the version on the lower right on the screen when running docui would be helpful too!

Cannot work using Nixpkgs in docker container

Description

Using nixpkgs in docker contaienr, error occurred.

gorilla@5972c8e3de96:~$ docui
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x87447b]

goroutine 1 [running]:
github.com/skanehira/docui/gui.(*info).display(0xc0003520c0)
        /build/source/gui/info.go:98 +0x3b
github.com/skanehira/docui/gui.newInfo(0xc000233820)
        /build/source/gui/info.go:92 +0x22e
github.com/skanehira/docui/gui.(*Gui).initPanels(0xc000233820)
        /build/source/gui/gui.go:157 +0xca
github.com/skanehira/docui/gui.(*Gui).Start(0xc000233820, 0xc000233820, 0xc00022eea0)
        /build/source/gui/gui.go:207 +0x2f
main.run(0xc0000ac120)
        /build/source/main.go:26 +0x221
main.main()
        /build/source/main.go:35 +0x74

[Bug] Enable to run docui on small terminal window

Thanks for creating docui. This project is awesome!
I would like to ask a question.

When I use docui on tmux + iTerm2 on Mac OSX, but the error below happened.

panic: invalid dimensions

goroutine 1 [running]:
github.com/skanehira/docui/panel.(*Gui).init(0xc4205fe240)
        /Users/gotchane/go/src/github.com/skanehira/docui/panel/gui.go:198 +0xece
github.com/skanehira/docui/panel.New(0x2, 0xc4205b3f78)
        /Users/gotchane/go/src/github.com/skanehira/docui/panel/gui.go:94 +0x150
main.main()
        /Users/gotchane/go/src/github.com/skanehira/docui/main.go:13 +0x2eanic: invalid dimensions

However, according to issue #66, it works fine when I increase window size.

If possible, I would like to fix this issue, could I? (However I'm newbie of golang...)

If there are already some outlines of fixing this issue, I'll follow them.

Any comments are welcome.

Ability to install or pull default docker images

As some users have load of images that they use as default. It would be nice to be able to pull certain images automatically if they are not already installed on system.

When using docker at first run it feels cumbersome to load one by one and sometimes some might forget what images to use.

error on go get on raspi

Installation mostly worked. But when compiling the go 11 parts, there is an error. Should this work or is it an unsupported platform?

# github.com/skanehira/docui/docker
docker/container.go:86: cannot use "github.com/docker/go-connections/nat".PortMap literal (type "github.com/docker/go-connections/nat".PortMap) as type "github.com/docker/docker/vendor/github.com/docker/go-connections/nat".PortMap in assignment

nil deref panic on ctrl-L with no containers running

My local docker currently has no containers running; exploring docui on a fresh download ( 08d7aa1 ) I pressed Ctrl-L and got a nil dereference panic.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x82e10f]

goroutine 84 [running]:
github.com/skanehira/docui/panel.(*ContainerList).ShowContainerLogs.func1(0xc000356380, 0xc0003904e0)
	/home/pdp/go/src/github.com/skanehira/docui/panel/containerPanel.go:716 +0x8f
created by github.com/skanehira/docui/panel.(*ContainerList).ShowContainerLogs
	/home/pdp/go/src/github.com/skanehira/docui/panel/containerPanel.go:708 +0x1e7

Compiled with go1.13beta1. But really, "no containers, ask to view logs of container, get a panic".

[improvement] Fix warning for golint

common/common.go:21:6: func StructToJson should be StructToJSON (golint)
func StructToJson(i interface{}) string {
     ^
common/error.go:6:2: error var NoContainer should have name of the form ErrFoo (golint)
	NoContainer = errors.New("No container")
	^
common/error.go:7:2: error var NoImage should have name of the form ErrFoo (golint)
	NoImage     = errors.New("No image")
	^
common/error.go:8:2: error var NoVolume should have name of the form ErrFoo (golint)
	NoVolume    = errors.New("No volume")
	^
common/error.go:9:2: error var NoNetwork should have name of the form ErrFoo (golint)
	NoNetwork   = errors.New("No network")
	^
docker/docker.go:218:10: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
		return errors.New(fmt.Sprintf("can not remove ids\n%s", errids))
		       ^
panel/infoPanel.go:64:1: receiver name info should be consistent with previous receiver name i for Info (golint)
func (info *Info) Name() string {
^
panel/infoPanel.go:68:1: receiver name info should be consistent with previous receiver name i for Info (golint)
func (info *Info) Edit(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) {
^
panel/infoPanel.go:72:1: receiver name info should be consistent with previous receiver name i for Info (golint)
func (info *Info) Refresh(g *gocui.Gui, v *gocui.View) error {
^

package installation

Create a package installation for various distro's.
Currently an ambiguous installation process, requiring varying commands to install

Support go get?

Any plan to support go get github.com/skanehira/docui ?
Building from the source is not always great as it takes time :)

[improvement] Update supported version of Go

Using Go Modules with Go version 1.11.3 lower fails to resolve dependency.
Related to this issue: golang/go#27093

$ go version
go version go1.11.3 darwin/amd64

$ go clean -modcache

$ GO111MODULE=on go install
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/mitchellh/go-homedir v1.0.0
go: finding github.com/mattn/go-runewidth v0.0.4
go: finding github.com/sirupsen/logrus v1.3.0
go: finding github.com/nsf/termbox-go v0.0.0-20190104133558-0938b5187e61
go: finding github.com/skanehira/gocui-component v0.0.0-20190103120946-5f5ba7f77c3b
go: finding github.com/jroimartin/gocui v0.4.0
go: finding github.com/fsouza/go-dockerclient v1.3.3
go: finding golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc
go: finding golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: finding github.com/stretchr/objx v0.1.1
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/konsorten/go-windows-terminal-sequences v1.0.1
go: finding golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33
go: finding github.com/gorilla/mux v1.6.2
go: finding github.com/pkg/errors v0.8.1
go: finding golang.org/x/sys v0.0.0-20190102155601-82a175fd1598
go: finding github.com/opencontainers/go-digest v1.0.0-rc1
go: finding gotest.tools v2.2.0+incompatible
go: finding github.com/docker/go-units v0.3.3
go: finding github.com/gorilla/context v1.1.1
go: finding github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
go: finding github.com/containerd/continuity v0.0.0-20181203112020-004b46473808
go: finding github.com/vishvananda/netlink v1.0.0
go: finding github.com/docker/libnetwork v0.8.0-dev.2.0.20180608203834-19279f049241
go: finding github.com/Microsoft/go-winio v0.4.11
go: finding github.com/opencontainers/runc v0.1.1
go: finding github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5
go: finding github.com/gogo/protobuf v1.2.0
go: finding github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc
go: finding github.com/docker/docker v0.7.3-0.20180827131323-0c5f8d2b9b23
go: finding github.com/google/go-cmp v0.2.0
go: finding github.com/docker/go-connections v0.4.0
go: finding github.com/opencontainers/image-spec v1.0.1
go: downloading github.com/jroimartin/gocui v0.4.0
go: downloading github.com/fsouza/go-dockerclient v1.3.3
go: downloading github.com/skanehira/gocui-component v0.0.0-20190103120946-5f5ba7f77c3b
go: downloading golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/sirupsen/logrus v1.3.0
go: downloading github.com/mitchellh/go-homedir v1.0.0
go: downloading github.com/nsf/termbox-go v0.0.0-20190104133558-0938b5187e61
go: downloading github.com/mattn/go-runewidth v0.0.4
go: downloading github.com/docker/docker v0.7.3-0.20180827131323-0c5f8d2b9b23
go: downloading github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5
go: downloading golang.org/x/sys v0.0.0-20190102155601-82a175fd1598
go: downloading github.com/docker/go-units v0.3.3
go: verifying github.com/docker/[email protected]: checksum mismatch
	downloaded: h1:Zl/9mUfPbYbnv895OXx9WfxPjwqSZHohuZzVcjJ5QPQ=
	go.sum:     h1:mJtkfC9RUrUWHMk0cFDNhVoc9U3k2FRAzEZ+5pqSIHo=

[document] This is a TUI tool, not CUI tool.

This is a TUI tool.
TUI means the Terminal User Interface.
CUI means the Command User Interface.

I'll fix the README as blow

# docui - TUI Client for Docker Written in Go

## About docui
docui is TUI Tool for Docker Client.  
docui can do thises.

It won't start

I am on Ubuntu 18.04.

Followed the installation steps but it just says

panic: unable to connect to Docker

goroutine 1 [running]:
github.com/skanehira/docui/panel.(*Gui).init(0xc000550000)
/home/xxx/go/src/github.com/skanehira/docui/panel/gui.go:241 +0x1057
github.com/skanehira/docui/panel.New(0x2, 0xc0000b83c0, 0x9465fe)
/home/xxx/go/src/github.com/skanehira/docui/panel/gui.go:127 +0x10a
main.main()
/home/xxx/go/src/github.com/skanehira/docui/main.go:50 +0x358
g]:

install error

@d-kuro
I run go install and got errors.
Do you understand the cause?

go: downloading github.com/docker/docker v0.7.3-0.20180827131323-0c5f8d2b9b23
go: verifying github.com/docker/[email protected]: checksum mismatch
        downloaded: h1:mJtkfC9RUrUWHMk0cFDNhVoc9U3k2FRAzEZ+5pqSIHo=
        go.sum:     h1:Zl/9mUfPbYbnv895OXx9WfxPjwqSZHohuZzVcjJ5QPQ=
```

Cannnot attach container from remote access.

When I press a in container list panel,there is no system reaction and can't attach container.
But I run docker attach commnad from prompt, it runs normaly.

Environment
Local OS : Windows 10
Remote OS : Amazon Linux AMI 2018.03
Docker Version : 18.06.1-ce
Remote access tool : Teraterm 4.11 and RLogin 2.4

[Improvement] Preallocated Slice

docui/panel/networkPanel.go

Lines 237 to 269 in 6a3f947

var keys []string
tmpMap := make(map[string]*Network)
for _, network := range n.Docker.Networks() {
if n.filter != "" {
if strings.Index(strings.ToLower(network.Name), strings.ToLower(n.filter)) == -1 {
continue
}
}
var containers string
net, err := n.Docker.NetworkInfo(network.ID)
if err != nil {
n.ErrMessage(err.Error(), n.name)
n.Logger.Error(err)
return
}
for _, endpoint := range net.Containers {
containers += fmt.Sprintf("%s ", endpoint.Name)
}
tmpMap[network.ID[:12]] = &Network{
ID: network.ID,
Name: network.Name,
Driver: network.Driver,
Scope: network.Scope,
Containers: containers,
}
keys = append(keys, network.ID[:12])
}

[Bug] can't run docui on linux

when run docui on linux, there have an error.

error:

panic: user: Current not implemented on linux/amd64

goroutine 1 [running]:
github.com/skanehira/docui/common.NewLogger(0xc00019a030)
        /Users/skanehira/dev/go/src/github.com/skanehira/docui/common/logger.go:20 +0x1c7
github.com/skanehira/docui/panel.New(0x2, 0x83dee0)
        /Users/skanehira/dev/go/src/github.com/skanehira/docui/panel/gui.go:91 +0x81
main.main()
        /Users/skanehira/dev/go/src/github.com/skanehira/docui/main.go:13 +0x2e

cause:
golang/go#6376

[Bug] Stop get resource list on goroutine when attach container .

Using goroutine to get resource list when init panels.
However, goroutine doesn't stop when attach container.

It need to stop goroutine before attach container.

//  monitoring container status interval 5s
go func() {
	for {
		i.Update(func(g *gocui.Gui) error {
			return i.Refresh(g, v)
		})
		time.Sleep(5 * time.Second)
	}
}()

reference article:
https://blog.y-yuki.net/entry/2017/04/29/000000
https://qiita.com/castaneai/items/7815f3563b256ae9b18d

can't run docui on macOS

Thank you for creating useful tools.
A problem occurred when installing.

I did:

$ go get -d github.com/skanehira/docui
$ cd $GOPATH/src/github.com/skanehira/docui
$ GO111MODULE=on go install
$ docui
panic: invalid dimensions

goroutine 1 [running]:
github.com/skanehira/docui/panel.(*Gui).init(0xc000072300)
	/Users/mimikun/go/src/github.com/skanehira/docui/panel/gui.go:192 +0xf57
github.com/skanehira/docui/panel.New(0x2, 0x1446a20)
	/Users/mimikun/go/src/github.com/skanehira/docui/panel/gui.go:94 +0x138
main.main()
	/Users/mimikun/go/src/github.com/skanehira/docui/main.go:13 +0x2e

my envrionments:

  • macOS 10.14.2
  • Docker CE v18.09.1
  • Go v1.11.4 darwin/amd64

Thanks.

[Improvement] If can't connect docker engine, it will panic

When run docui and if can't connect docker engine, it will pacni.

panic: unable to connect to Docker

goroutine 1 [running]:
github.com/skanehira/docui/panel.(*Gui).init(0xc000082180)
        /Users/skanehira/dev/go/src/github.com/skanehira/docui/panel/gui.go:196 +0xf57
github.com/skanehira/docui/panel.New(0x2, 0xc00000e0a8, 0x0)
        /Users/skanehira/dev/go/src/github.com/skanehira/docui/panel/gui.go:92 +0x12a
main.main()
        /Users/skanehira/dev/go/src/github.com/skanehira/docui/main.go:24 +0x208
exit status 2
```

Snap package

Any plans to release as a snap package?

Snapcraft.io

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.