【问题标题】:Run Docker in Windows 10在 Windows 10 中运行 Docker
【发布时间】:2023-03-30 17:58:01
【问题描述】:

我正在尝试在 Windows 10 上安装和运行 docker,但我遇到了这个错误,

我正在执行这些步骤

  • 安装虚拟盒子
  • 关闭 Hyper-V
  • 重启电脑
  • docker-machine 创建框
  • 开启 Hyper-V
  • 重启电脑
  • docker-machine 启动框

错误

This is a known VirtualBox bug. Let's try to recover anyway... Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue

我读过这个 github issue 和 this one ,但仍然有同样的错误。

有人可以帮助我吗?

我使用的是 VirtualBox 版本 5.2.8-121009-Win

一些命令和结果

docker ps

error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/containers/json: open //./pipe/docker_engine: O sistema não pode encontrar o arquivo especificado. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

docker-machine ls

NAME   ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER    ERRORS
box    -        virtualbox   Stopped                 Unknown

docker-machine 启动框

This is a known VirtualBox bug. Let's try to recover anyway...
Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue

【问题讨论】:

  • 我能问一下您为什么使用 Virtual Box,但仍然启用了 HyperV?既然启用了 HyperV,为什么不直接使用在 HyperV 中运行的默认 Docker/Windows 10 Linux 主机?
  • @MichaelLloydLeemlk 我是 docker 的初学者,我只是在学习一些教程。我禁用了 HyperV 并尝试了 docker-machine start box(我用 docker-machine create box 创建了它)但仍然遇到同样的错误
  • 听起来您正在学习旧教程。启用 Hyper-V,安装最新版本的 Docker for Windows,它应该可以正常工作。 Docker for Windows 将在 Hyper-V 中为您创建一个运行 Linux 的 VM。

标签: docker


【解决方案1】:

根据您上面的 cmets,听起来您要么遵循旧教程(Docker for Windows 之前),要么遵循不符合 Docker for Windows(即 Windows 10 Home)要求的设备教程。鉴于您要关闭 Hyper-V,我假设您使用的是 Windows 10 Pro。

最新版本的 Docker for Windows 不使用 docker-machine 命令,而是在 Hyper-V 的“幕后”中为您创建一个 VM。你应该可以只用installing Docker for Windows

【讨论】:

  • 无法创建:正在运行的命令已停止,因为首选项变量“ErrorActionPreference”或公共参数设置为停止:Hyper-V 无法找到名为“DockerNAT”的虚拟交换机。在 New-Switch 处,:Docker.Backend.HyperV.RunScript(字符串操作,Dictionary`2 参数)处 Docker.Backend.ContainerEngine.Linux.Start(设置设置)处 Docker.Core.Pipe 处的第 123 行。 NamedPipeServer.c__DisplayClass8_0.b__0(Object[] 参数)
  • github.com/docker/for-win/issues/324 我以前也遇到过这个问题,我必须卸载 Docker,进入 HyperV 应用程序并删除所有内容(虚拟机、交换机等),然后重新安装。
猜你喜欢
  • 1970-01-01
  • 2020-12-07
  • 2021-03-25
  • 2019-07-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多