docker - 在 Windows 上使用 ssh 连接到 docker daemon

标签 docker docker-machine docker-for-windows docker-desktop

我使用 https://docs.docker.com/docker-for-windows/install/#install-docker-for-windows 在 Windows 10 上安装了 Docker Desktop for Windows .它不使用 VirtualBox 和默认 VM 来托管 docker。

我可以运行容器,但是如何使用 ssh 连接到 docker?

docker-machine ls 不显示我的 docker 主机。

尝试连接到 docker@10.0.75.1 但它需要密码。而用于 boot2docker 虚拟机的 tcuser 不匹配:

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's password: Write failed: Connection reset by peer

最佳答案

运行这个:

docker run -it --rm --privileged --pid=host justincormack/nsenter1

Just run this from your CLI and it'll drop you in a container with full permissions on the Moby VM. Only works for Moby Linux VM (doesn't work for Windows Containers). Note this also works on Docker for Mac.

引用: https://www.bretfisher.com/getting-a-shell-in-the-docker-for-windows-vm/

关于docker - 在 Windows 上使用 ssh 连接到 docker daemon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44370059/

相关文章:

ubuntu - 如何减少 .NET Core docker 容器的内存使用量?

docker - mkdir : cannot create directory '/ffa_app' : Permission denied

docker与windows和linux容器共享网络

bash - Docker容器看不到串口设备

go - 在 docker 上更改文件时重建

scala - 在暂存或发布docker时sbt无法生成bin目录+其他问题

docker - 使用已安装的节点软件包的配置版本构建Docker镜像

docker - 如何从 Docker-for-mac 或 Docker-for-Windows 获取可浏览的 url?

docker - 构建Docker镜像时无法写入 '/dev/tty'

docker - Java : Connecting to Redis cluster running in minikube