Google Cloud Filestore如果不是因为您必须提供1TB或更多的数据,而这对于一个小的非生产性利润项目而言却变得可贵的话,则可能是理想的选择.是否可以将存储桶作为文件系统挂载到docker映像上?我可以挂载Google Persistent Disk吗?解决方案您无法将存储桶安装到构建中,但是您可以在构建结束时将.M2目录复制到存储桶中,然后还原它在后续构建的开始.我已直接从文档,以防消失.steps:- name: gcr.io/cloud-builders/gsutil args: ['cp', 'gs://mybucket/results.zip', 'previous_results.zip']# operations that use previous_results.zip and produce new_results.zip- name: gcr.io/cloud-builders/gsutil args: ['cp', 'new_results.zip', 'gs://mybucket/results.zip']当将此策略与并发构建混合使用时,请当心.I have a maven spring-boot project deployed on appengine that I am building and deploying using Google Cloud Build using the following builder image: https://github.com/strudeau/mvn-gcloud-builderWhen performing a build, most of the time is spent downloading the plugins and dependencies from maven. I would like to be able to mount a persistent volume to this Docker image so as to be able to keep a persistent .M2 directory where my plugins and dependencies would be stored to avoid having them downloaded each time I do a build.Google Cloud Filestore would probably be ideal if it weren't for the fact that you have to provision 1TB of data or more which becomes ridiculously expensive for a small non-production profit project.Is there a way to mount a bucket as a filesystem on the docker image?Can I mount a Google Persistent Disk? 解决方案 You can't mount a bucket into the build, but you can copy your .M2 directory out to a bucket at the end of a build, then restore it at the beginning of a subsequent build.I've lifted the example directly from the documentation, in case it disappears.steps:- name: gcr.io/cloud-builders/gsutil args: ['cp', 'gs://mybucket/results.zip', 'previous_results.zip']# operations that use previous_results.zip and produce new_results.zip- name: gcr.io/cloud-builders/gsutil args: ['cp', 'new_results.zip', 'gs://mybucket/results.zip']Watch out when mixing this strategy with concurrent builds. 这篇关于如何将永久性存储连接到Google Cloud Build?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-06 20:26