How to connect to docker VM (MobyLinux) from windows shell?

↘锁芯ラ 提交于 2019-12-20 08:48:07

问题


Is there away to log into host VM's shell, similarly to how can we easily enter into running containers bash?

docker exec -it bash

I accidentally broke one container's crucial file, so that it couldn't start. Unfortunately, that container stored it's data inside. The result was that whenever I tried to run it, it couldn't start. The only solutions I saw were about navigating to host docker daemon's files. However, I'm running docker VM on windows, and I cannot access the files inside VM (MobyLinuxVM).

I'm using Docker for Windows, version 1.12.3-beta30.1 (8711)


回答1:


Hack your way in

run a container with full root access to MobyLinuxVM and no seccomp profile (so you can mount stuff)

docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh

https://forums.docker.com/t/how-can-i-ssh-into-the-betas-mobylinuxvm/10991/6



来源:https://stackoverflow.com/questions/40867501/how-to-connect-to-docker-vm-mobylinux-from-windows-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!