gpt4 book ai didi

docker - 无法在Windows上的Docker中运行节点项目

转载 作者:行者123 更新时间:2023-12-02 19:53:26 27 4
gpt4 key购买 nike

我想在docker中运行我的节点项目。从Docker构建应用程序时出现此错误

error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares==0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=vgi82r9lm7xo2khvpnget=&ulimits=null&version=1: open
//.moghe8i&shmsize=0&t=project-node&target=&ulimits=null&version=1: open //./pipe/docker_engine: The system cannot find the file specified. In the dvated to connect. This error may alsoefault 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文件
FROM node:latest
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD [ "node", "index.js" ]

所有与项目相关的文件都位于同一文件夹中

我是Docker的新手,有人可以帮助我解决此问题吗

最佳答案

问题

If the Docker daemon fails to start up with Windows, or stops for some reason, you can get network connection errors or warnings regarding the Docker daemon service when you try to run any commands:


the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

先决条件

在执行这些步骤之前,您必须满足以下要求:
  • Windows 10
  • Windows的Docker

  • 分辨率

    When the Docker daemon fails to start on Windows, or stops unexpectedly during normal operations, you'll get a network connection error regarding the Docker daemon letting you know that it is unreachable. The Docker daemon is also commonly referred to as the Docker for Windows service. Usually, restarting the service will resolve the error.



    选项1:
  • 通过Windows GUI通过右键单击服务并选择重新启动(或右键单击,停止,右键单击,启动)来重新启动Docker for Windows服务:

  • enter image description here

    选项2:
    Net stop com.docker.service
    Net start com.docker.service

    docker-for-windows-fails-with-a-daemon-not-running-message

    关于docker - 无法在Windows上的Docker中运行节点项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59241606/

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