-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Description
In one particular linux environment I work in, no matter what virtual machine I ssh into, my home directory roams with me (i.e. it is using shared storage). While I have nothing to do with that configuration, it is convenient for many things. However, I tried to create a docker context using ssh:// format to connect to a VM that is a swarm manager. When I do then docker use <contextname> and issue just about any docker command, it will hang and never return anything from the command.
Steps to reproduce the issue:
- Have a linux home directory that uses shared or synchronized storage on 2 or more systems.
- Create a new docker context on one of the machines/vms using an ssh connection:
docker context create mycontext --docker "host=ssh://username@server" - Activate the remote context:
docker context use mycontext - Issue a simple command such as
docker ps
Describe the results you received:
Command never returned.
Describe the results you expected:
See a list of containers running on the remote machine.
Additional information you deem important (e.g. issue happens only occasionally):
What I believe is happening is that when I create and use a context, it's stored in ~/.docker/context according to the docs. Since this is shared across all vm's that I ssh into, the first instant I run a command it ssh's into the vm, tries to run the docker command which sees that the current context is ssh and it recursively gets stuck in an endless loop.
I believe the same thing could happen on Windows as well if roaming profiles were turned on depending on where the ".docker/context" folder lives.
Output of docker version:
The system is air-gapped so I can't paste the full version/info commands.
Version: 19.03.9
CLI Version: 1.40