简体   繁体   English

Docker 映像构建 Windows 10 上的“访问被拒绝”错误

[英]Docker image build "Access is denied” error on Windows 10

I'm trying to build a node docker image for an application using Firebase and React on Windows 10, but it's giving me the following error:我正在尝试为使用 Firebase 和 React on Windows 10 的应用程序构建节点 docker 映像,但它给了我以下错误:

> docker build -t projectName .
[+] Building 15.5s (6/8)
 => [internal] load build definition from Dockerfile                                                                                                            0.0s 
 => => transferring dockerfile: 31B                                                                                                                             0.0s 
 => [internal] load .dockerignore                                                                                                                               0.0s 
 => => transferring context: 2B                                                                                                                                 0.0s 
 => [internal] load metadata for docker.io/library/node:latest                                                                                                 11.0s 
 => [auth] library/node:pull token for registry-1.docker.io                                                                                                     0.0s 
 => ERROR [internal] load build context                                                                                                                         4.3s 
 => => transferring context: 102.71MB                                                                                                                           4.3s 
 => CACHED [1/3] FROM docker.io/library/node:latest@sha256:ca6daf1543242acb0ca59ff425509eab7defb9452f6ae07c156893db06c7a9a4                                     0.0s 
------
 > [internal] load build context:
------
error from sender: open functions\node_modules\google-gax\protos\google\iam\v1\logging: Access is denied.

Dockerfile: Dockerfile:

FROM node:latest
COPY . .
RUN npm install
CMD npm run start

I've tried different node versions, pulling the image and then building it again, but it doesn't seem to fix the error.我尝试了不同的节点版本,提取图像然后再次构建它,但它似乎无法修复错误。 This is the first time I'm using docker (other than the getting-started tutorial, which worked), so please let me know if there's anything I need to add?这是我第一次使用 docker(除了入门教程,它有效),所以请告诉我是否需要添加任何内容? Any ideas?有任何想法吗?

As theJeztah has pointed it out, the build-daemon can't access functions\\node_modules\\google-gax\\protos\\google\\iam\\v1\\logging .正如theJeztah指出的那样,构建守护进程无法访问functions\\node_modules\\google-gax\\protos\\google\\iam\\v1\\logging

This can also happen if your file paths are too long.如果您的文件路径太长,也会发生这种情况。 In my case I have solved it by moving the folder to a directory with a shorter path.在我的情况下,我通过将文件夹移动到路径较短的目录来解决它。

This answer provides a powershell command to find long paths: Get-ChildItem -Path $dir -Recurse -Directory | % { $_.FullName } | Sort-Object { $_.Length } -Descending | Select -first 5此答案提供了一个 powershell 命令来查找长路径: Get-ChildItem -Path $dir -Recurse -Directory | % { $_.FullName } | Sort-Object { $_.Length } -Descending | Select -first 5 Get-ChildItem -Path $dir -Recurse -Directory | % { $_.FullName } | Sort-Object { $_.Length } -Descending | Select -first 5

I happened to have this error and I just updated the Docker to the latest version and resolved this issue.我碰巧遇到了这个错误,我刚刚将 Docker 更新到最新版本并解决了这个问题。

暂无
暂无

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

相关问题 在 windows10 中使用 docker 桌面拉取大图像最后总是失败,并出现错误“未授权:身份验证失败” - large image pull using docker desktop in windows10 always failed at the end with error "unauthorized: failed authentication" 即使在更改策略后,管道也不会构建并显示 access_denied 错误 - Pipleline wont build and shows access_denied error even after changing policies Gitlab Runner 与 Docker 和 shell 错误 - 权限被拒绝 - Gitlab Runner with Docker and shell error — Permission denied 来自守护程序的错误响应:registry.gitlab.com 存储库不存在或可能需要“docker login”的请求访问被拒绝 - Error response from daemon: pull access denied for registry.gitlab.com repository does not exist or may require 'docker login' jib gradle 插件 + static docker 客户端:由于权限错误而无法构建图像:layer.tar:客户端未拥有所需的权限 - jib gradle plugin + static docker client: cannot build image due to permission error: layer.tar: A required privilege is not held by the client 使用 Django 存储在 GCS 上上传图像时访问被拒绝 Package - Access Denied when upload image on GCS using Django Storage Package 如何访问 docker 图像的 Dockerfile? - How to get access to Dockerfile of a docker image? 如何在 GCP Cloud Build 的 Terraform Docker Provider 中构建和推送 docker 映像 - How to build and push a docker image in a Terraform Docker Provider by GCP Cloud Build 执行 Google Dataform 工作流程会导致错误访问被拒绝 - Execution of Google Dataform workflow gives error access denied AWS EC2 Windows 10 无法访问元数据 - AWS EC2 Windows 10 can't access metadata
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM