gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-28 21:35:31 28 4
gpt4 key购买 nike

我使用 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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com