在做.net微服务练习的时候
第一次执行docker build 出现【 the docker client must be run elevated to connect】
docker build -t mymicroservice .
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&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=k1gjibwk3bmcjva9lk606hc15&shmsize=0&t=mymicroservice&target=&ulimits=null&version=1: open //./pipe/docker_engine:
The system cannot find the file specified. 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图标,更改【switch to windows containers】,就可以成功。

重新运行后开始拉取文件构建镜像:

本文介绍了解决在Windows环境下使用Docker构建.NET微服务镜像时遇到的问题。主要错误为客户端必须以管理员权限运行才能连接到默认配置的Docker守护进程。通过将Docker切换到Windows容器模式,可以成功构建。
1537

被折叠的 条评论
为什么被折叠?



