Can not use DOCKER_HOST with ssh and no -H command line option
Docker allows users to set DOCKER_HOST using ssh but lazydocker fails. E.g.
pc:~ export DOCKER_HOST="ssh://vb1"
pc:~ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ee51f3403535 keepalived:latest "/etc/keepalived/sta…" 19 minutes ago Up 15 minutes keepalived
32f8de6c3b34 portainer/agent "./agent" 19 minutes ago Up 15 minutes 0.0.0.0:9001->9001/tcp portainer
b38f73b4f61f smsif2:latest "python -u smsif2" 19 minutes ago Up 15 minutes 0.0.0.0:8010->8010/tcp smsif2
pc:~ lazydocker
2020/04/01 16:22:27 An error occurred! Please create an issue at https://github.com/jesseduffield/lazydocker/issues
*errors.withStack error during connect: Get "http://vb1/v1.25/images/json": dial tcp: lookup vb1: no such host
main.go:88 (0x8ba8e8)
/usr/lib/go/src/runtime/proc.go:203 (0x436fd2)
main: fn()
/usr/lib/go/src/runtime/asm_amd64.s:1373 (0x464471)
goexit: BYTE $0x90 // NOP
Also, docker and most other docker tool provide -H to use instead of having to set DOCKER_HOST. Ideally lazydocker would add this.
pc:~ unset DOCKER_HOST
pc:~ docker -H="ssh://vb1" ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ee51f3403535 keepalived:latest "/etc/keepalived/sta…" 22 minutes ago Up 18 minutes keepalived
32f8de6c3b34 portainer/agent "./agent" 22 minutes ago Up 18 minutes 0.0.0.0:9001->9001/tcp portainer
b38f73b4f61f smsif2:latest "python -u smsif2" 22 minutes ago Up 18 minutes 0.0.0.0:8010->8010/tcp smsif2
pc:~ lazydocker -H="ssh://vb1"
lazydocker - The lazier way to manage everything docker
https://github.com/jesseduffield/lazydocker
Flags:
--version Displays the program version string.
-h --help Displays help with available flag, subcommand, and positional value parameters.
-c --config Print the current default config
-d --debug a boolean
-f --file Specify alternate compose files
Unknown arguments supplied: H=ssh://vb1
pc:~ lazydocker --version
Version: 0.8
Date:
BuildSource: unknown
Commit:
OS: linux
Arch: amd64
Lazydocker on up to date Arch Linux, AUR version 0.8-1.
Yes, Using ssh as Docker host was added in docker 18.09.0. Maybe update docker dependencies may help?
Dry PR#128 was doing the same thing by simply updating the dependencies.
Tried wit the latest 0.20 release
DOCKER_HOST=ssh://pi@xxx lazydocker
2022/12/07 13:47:02 tunnel ssh docker host: ssh tunneled socket never became available: context deadline exceeded
any news on this? would be great to have it...
Hmm, found that on a different remote machine it works. Maybe this is a timeout issue? @jesseduffield is there a way to configure a longer timeout?
Just encountered this problem with this version of lazydocker:
Version: 0.21.1
Date: 2023-08-03T10:40:38Z
BuildSource: binaryRelease
Commit: c635266fae82f9c41456053cb5cee19280b40b9b
OS: linux
Arch: amd64
Any workaround available?