简体   繁体   English

Docker 为 windows 将无法启动

[英]Docker for windows will not start

I have installed Docker for windows as a complete noob looking to try it out.我已经为 windows 安装了 Docker 作为一个完整的新手,希望尝试一下。 I have ensured Hyper-V is enable, virtualisation is enabled also我确保 Hyper-V 已启用,虚拟化也已启用

any time I try and run the docker desktop the whale icon is red and it states that it could not start, and if I try to run a command like from cmd I get teh following error任何时候我尝试运行 docker 桌面时,鲸鱼图标都是红色的,它表示它无法启动,如果我尝试运行 cmd 之类的命令,我会收到以下错误

error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/images/json: open //./pipe/docker_engine: The system cannot find the file specified.连接期间出错:获取 http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/images/json: 打开 //./pipe/docker_engine: 系统找不到指定的文件。 In the default daemon configuration on Windows, the docker client must be run elevated to connect.在 Windows 上的默认守护进程配置中,docker 客户端必须以提升的方式运行才能连接。 This error may also indicate that the docker daemon is not running.此错误还可能表示 docker 守护程序未运行。

I am at a loss as to how I can trouble shoot.我不知道如何解决问题。

I have also noticed that the STATE when i list my WSL devices is always set as "Installing" even if I completely uninstall Docker through Add/Remove programs我还注意到,当我列出我的 WSL 设备时,STATE 始终设置为“正在安装”,即使我通过添加/删除程序完全卸载了 Docker

在此处输入图像描述

I have had similar error and solved as follow;我有类似的错误并解决如下;

  1. In cmd, on admin mode run below command:在 cmd 中,在管理员模式下运行以下命令:

    docker-machine restart default docker-machine 重启默认

if you see anything like: it is not exist then run: docker-machine create如果你看到类似:它不存在然后运行: docker-machine create

  1. Then you'll get a message something like:然后你会收到类似这样的消息:

open C:\User\{User_name}\.docker\machine\machines\default\config.json: The system cannot find the file specified.打开 C:\User\{User_name}\.docker\machine\machines\default\config.json:系统找不到指定的文件。

  1. Go to the docker icon which will be on your windows tray (bottom right corner of the desktop) Go 到 docker 图标,该图标将位于您的 windows 托盘(桌面右下角)

  2. Right click on the docker icon > Settings > Reset > Restart Docker右键单击 docker 图标 > 设置 > 重置 > 重启 Docker

This solution worked for me.这个解决方案对我有用。 And reference for this answer: docker cannot start on windows此答案的参考: docker cannot start on windows

Literally do as it says: launch Docker as admin.照它说的做:以管理员身份启动 Docker。

Quit Docker, and ensure it is no longer running.退出 Docker,并确保它不再运行。 You should be able to see if its running in the system tray.您应该能够查看它是否在系统托盘中运行。 Right click -> Quit Docker Desktop右键 -> 退出 Docker 桌面

在此处输入图像描述

It may take a few seconds for it to stop.它可能需要几秒钟才能停止。 Wait for the windows notification:等待 windows 通知: 在此处输入图像描述

Navigate to the installation directory, which for me was defaulted to C:\Program Files\Docker\Docker .导航到安装目录,对我来说默认为C:\Program Files\Docker\Docker Launch Docker Desktop.exe as admin以管理员身份启动Docker Desktop.exe

在此处输入图像描述

This will open the Docker UI.这将打开 Docker UI。 Wait for Docker to fully start up before attempting to consume its services等待 Docker 完全启动,然后再尝试使用其服务

I had the same problem and here's how I solved it.我有同样的问题,这就是我解决它的方法。 Install the Docker and please follow brief instructions...安装 Docker 并按照简要说明进行操作...

First - I enabled virtualization from BIOS.首先- 我从 BIOS 启用了虚拟化。

Second - I downloaded and installed Linux kernel update package.第二- 我下载并安装了 Linux kernel 更新 package。

Third - Go to "Turn windows features on and off" window Check whether following is checked...第三- Go 到“打开和关闭 windows 功能” window 检查是否检查以下...

        * Virtual Machine Platform

        * Windows Hypervisor Platform 

        * Windows Subsystem for Linux 

You need to restart the PC and Docker will be working.您需要重新启动 PC,Docker 才能正常工作。 Please refer the following link and it will definitely give you more information - https://docs.docker.com/docker-for-windows/install/请参考以下链接,它肯定会为您提供更多信息 - https://docs.docker.com/docker-for-windows/install/

Have you tried running Docker using WSL2?您是否尝试过使用 WSL2 运行 Docker?

https://docs.docker.com/docker-for-windows/wsl/ https://docs.docker.com/docker-for-windows/wsl/

Go to Powershell (run as administrator), and run this lines Go 到 Powershell(以管理员身份运行),并运行此行

cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon

check if it set on Linux conteiners overwise switch to Linux检查它是否设置在 Linux conteiners 过度切换到 Linux

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM