skanehira / docui Goto Github PK
View Code? Open in Web Editor NEWTUI Client for Docker
License: MIT License
TUI Client for Docker
License: MIT License
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]:
as the title says
https://circleci.com/gh/skanehira/docui/258
Related issue: golang/lint#436
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
I will added feature of asynchronous operation.
ex. create container during pulling image.
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:
docui --endpoint https://x.x.x.x:xxxx
DOCKER_HOST
is preferable when the argument is not specified.Create a package installation for various distro's.
Currently an ambiguous installation process, requiring varying commands to install
I'll add monitoring the running processes of a container.
Switch to monitoring mode with Ctrl + t for the specified container.
relate:
#72
Use entrypoint in docker container to run docui but docui(termbox) can't get terminal window size.
It need to wait SIGWHICH to get terminal size.
Hi
I'm really impressed your project and I want to use it.
But it doesn't correctly work in Ubuntu18.04.
If i'm using tmux, docui doesn't launch with no error.
I checked $HOME/docui.log
, there is no log.
This is preview.
If i use normal shell (not tmux), docui
command launch application.
However, UI is something wrong.
Please look at this gif
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.
If i use dockerized docui, everything work fine.
UI is correct, and if i used tmux, it's fine.
Ubuntu 18.04.3 LTS
74b1e89
bd2021d6e1b6da00ca7b842679648d577bac0c53
related:
#38
now:
When attach container docui call docker attach
internally.
after:
Use docker api exec create
exec start
to attach container.
Can't attach container when no docker client.
It's need to Add only the docker client to the docui image.
Add docui's config.yaml.
I' ll support create new network.
Add logger.
Error level: error, info
Add comment to source code to pass golinter.
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
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=
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
Any plans to release as a snap package?
Snapcraft.io
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 {
^
relate:
#38 (comment)
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:
Thanks.
エンターで対話型コンテナに移りたいのですが、可能でしょうか。
I'll add new feature of monitoring container's resources.
Switch to resource monitoring mode with Ctrl + m for the specified container.
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
To be able asynchronous remove operation.
I'll Add new feature of monitoring container's logs.
Switch to log monitoring mode with Ctrl + l for the specified container.
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.
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.
Lines 237 to 269 in 6a3f947
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!
go version go1.12beta2 windows/amd64
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
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.
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
Currently create a container using HostIP 0.0.0.0
.
options.HostConfig.PortBindings = map[docker.Port][]docker.PortBinding{
docker.Port(port + "/tcp"): {
{
HostIP: "0.0.0.0",
HostPort: hostPort,
},
},
}
Specify host ip and use it to create container.
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
```
Any plan to support go get github.com/skanehira/docui
?
Building from the source is not always great as it takes time :)
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.
Distro: Ubuntu18.04
docker: 18.09.5
Thanks.
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".
This is tcell’s problem.
refer rivo/tview#165
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
@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=
```
like #83
but support for home brew
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.