Skip to content

19.03.0-beta1: docker context commands hang if current engine is not reachable #1831

@StefanScherer

Description

@StefanScherer

Description

After switching to an unreachable Docker context, all the docker context commands hang. It seems like the docker CLI talks too early with the remote engine.

Steps to reproduce the issue:

  1. Create a docker context remote for a remote Docker engine, or simulate it with
    docker context create remote --docker "host=tcp://1.2.3.4:2375"
  2. docker context use remote
  3. Turn off WiFi/network connection, not needed if you simulate it
  4. Run docker context ls
  5. Run docker context use default
  6. Run docker context -h

Describe the results you received:

Commands in step 4. - 6. will hang for a long time and gives a bad user experience.

Describe the results you expected:

The commands docker context ls and docker context use should work without communicating with the Docker engine of the current context.
Reason: To easily switch back to Docker Desktop without a delay.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

$ docker version
Client: Docker Engine - Community
 Version:           19.03.0-beta1
 API version:       1.39 (downgraded from 1.40)
 Go version:        go1.12.1
 Git commit:        62240a9
 Built:             Thu Apr  4 19:15:32 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Output of docker info:

(paste your output here)

Additional environment details (AWS, VirtualBox, physical, etc.):

Interesting detail when I use the default context (Docker Desktop in my case) a docker context use remote is also fast, so switching to a context that is not reachable works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions