简体   繁体   English

Docker 构建在 windows 10 上无限期挂起

[英]Docker build hangs indefinitely on windows 10

When i run docker build -t student-app-client.当我运行docker build -t student-app-client. to build the docker image nothings happens for long time.构建 docker 映像长时间没有发生。 Docker file is fine and it's working fine on Linux Docker 文件很好,它在 Linux 上工作正常

docker version : 19.03.8 docker 版本:19.03.8

Windows version : Windows 10 pro Windows 版本:Windows 10 pro

I realized that during docker build, docker was reading all files in the root directory folder which had lot of files.我意识到在 docker 构建期间,docker 正在读取包含大量文件的根目录文件夹中的所有文件。

I added all these files in .dockerignore .我在.dockerignore中添加了所有这些文件。 After this build completed with in minute.在此构建完成后一分钟。

Sample .dockerignore file示例.dockerignore文件

/node_modules/
/build/

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

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