docker-modem icon indicating copy to clipboard operation
docker-modem copied to clipboard

Support reading from .ssh/config

Open chrmarti opened this issue 5 years ago • 5 comments

With the support for ssh:// for the Docker host in, it would be great if .ssh/config would be supported like the Docker CLI does too. There is the ssh2-config NPM package helping with that.

chrmarti avatar Nov 07 '19 13:11 chrmarti

Was this resolved?

phuctm97 avatar Mar 06 '20 11:03 phuctm97

Not that I know.

chrmarti avatar Mar 06 '20 13:03 chrmarti

I would love to see this fixed too. Here are more detailed repro steps--hope this helps

  1. Configure an SSH host with a non-DNS-resolvable name (Host field in./ssh/config, e.g. mydevbox) that maps to real machine name or IP address (HostName field, e.g. mydevbox.real.dns.name). See http://man7.org/linux/man-pages/man5/ssh_config.5.html for details. The following steps assume Docker is installed on mydevbox machine.
  2. Set up SSH public key authentication to mydevbox (see https://www.ssh.com/ssh/agent for details)
  3. Verify SSH connection to mydevbox works (ssh mydevbox should suffice)
  4. Set DOCKER_HOST to ssh://mydevbox. Verify Docker CLI works and shows Docker assets on mydevbox (docker ps, docker images etc).
  5. Try to open a connection to Docker using docker-modem

Expected: it should work, just like the Docker CLI Actual: it does not work. This is because docker-modem implementation requires the host to be fully resolvable through DNS. Even placing an entry in /etc/hosts does not help

Using non-DNS-resolvable name comes handy in several situations, for example:

  • The machine running Docker is an ephemeral machine with no public DNS entry
  • The host nickname is used as a way to indicate what user identity to use when connecting to the host

karolz-ms avatar Mar 17 '20 03:03 karolz-ms

@karolz-ms I had same issues, too. Therefore, I'm going to create a PR fixing this, however it's just going to happen in at least two more weeks.

phuctm97 avatar Mar 17 '20 04:03 phuctm97

@phuctm97 that would be awesome, let me know if I can be of help!

karolz-ms avatar Mar 17 '20 16:03 karolz-ms