WSL2 bug

错误现象

Stdout:

Stderr:
2020/05/27 20:01:37 resolving /mnt/host/c/Program Files/Docker/Docker/resources/wsl/docker-wsl-cli.iso...
Error: mounting wslCLIDest: stat /mnt/host/c/Program Files/Docker/Docker/resources/wsl/docker-wsl-cli.iso: no such file or directory
2020/05/27 20:01:37 stat /mnt/host/c/Program Files/Docker/Docker/resources/wsl/docker-wsl-cli.iso: no such file or directory
mounting wslCLIDest
main.doRun
/go/src/github.com/docker/pinata/linuxkit/pkg/wsl-bootstrap/main.go:224
main.run.func1
/go/src/github.com/docker/pinata/linuxkit/pkg/wsl-bootstrap/main.go:83
github.com/docker/pinata/vendor/github.com/spf13/cobra.(*Command).execute
/go/src/github.com/docker/pinata/vendor/github.com/spf13/cobra/command.go:838
github.com/docker/pinata/vendor/github.com/spf13/cobra.(*Command).ExecuteC
/go/src/github.com/docker/pinata/vendor/github.com/spf13/cobra/command.go:943
github.com/docker/pinata/vendor/github.com/spf13/cobra.(*Command).Execute
/go/src/github.com/docker/pinata/vendor/github.com/spf13/cobra/command.go:883
main.main
/go/src/github.com/docker/pinata/linuxkit/pkg/wsl-bootstrap/main.go:25
runtime.main
/usr/local/go/src/runtime/proc.go:203
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1373`

错误原因

wsl2本身的bug,具体原因不详

解决办法

  • quit docker desktop
  • stop docker service in service.msc which should be called com.docker.service
    WSL2 bug_第1张图片
  • shutdown wsl: wsl --shutdown
  • start docker windows

wsl2的使用

windows 的docker desktop只是基于wsl中的linux做初始化,真正的docker守护进程并不在linux内。所以在对应的wsl系统中,敲击docker命令会得到如下问题

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

所以,一切的docker的管理,还得在windows的shell中进行

参考资料

https://github.com/docker/for-win/issues/6822

欢迎关注我的个人公众号"西北偏北UP",记录代码人生,行业思考,科技评论

你可能感兴趣的