如何修复 Google Cloud Build 忽略 .dockerignore
问题:
你想在 Google Cloud Build 上运行 docker 镜像构建,但客户端试图向 Google Cloud 上传巨大的上下文镜像,即使你已将所有大目录添加到 .dockerignore 并且构建在本地正常工作。
解决方案
Google Cloud Build 按设计忽略 .dockerignore - 等效文件称为 .gcloudignore。
你可以通过运行以下命令为 gcloud 复制 .dockerignore 行为
copy-dockerignore-to-gcloudignore.sh
cp .dockerignore .gcloudignoreIf this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow