Connect with ssh to docker daemon on windows
I installed docker on Windows 10 from https://docs.docker.com/docker-for-windows/install/#install-docker-for-windows . It doesn't use VirtualBox and VM by default to host docker.
I can run containers, but how do I connect to docker using ssh?
docker-machine ls
doesn't show my docker host.
Tried connecting to docker@10.0.75.1 but it requires a password. And tcuser
which is used for boot2docker VM not matching
ssh docker@10.0.75.1
Could not create directory '/home/stan/.ssh'.
The authenticity of host '10.0.75.1 (10.0.75.1)' can't be established.
RSA key fingerprint is ....
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/stan/.ssh/known_hosts).
docker@10.0.75.1 password:
Write failed: Connection reset by peer
source to share
As far as I know, you cannot connect to the docker VM using SSH, and you also cannot connect to the console / terminal using Hyper-V manager. https://forums.docker.com/t/how-can-i-ssh-into-the-betas-mobylinuxvm/10991/17
source to share
Run this:
docker run -it --rm --privileged --pid=host justincormack/nsenter1
Just run this from your CLI and it will drop into a container with full permissions on the Moby VM. Only works for Moby Linux VM (does not work for Windows Containers). Note that this also works on Docker for Mac.
Link: https://www.bretfisher.com/getting-a-shell-in-the-docker-for-windows-vm/
source to share