Skip to content

Can not use DOCKER_HOST with ssh and no -H command line option #213

Description

@bulletmark

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions