Reputation: 3586
I have two containers, the first modifies some files in the repo and the second has those files ADD
ed into it, locally I would map a volume on my host machine and they could both use it, is this possible in Container Builder? I am not seeing the changes the first container made in my second container.
Upvotes: 1
Views: 1217
Reputation: 1
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '-r', 'gs://${_BUCKET_PREFIX}/model', '/workspace']
id: 'download-model'
- name: 'gcr.io/cloud-builders/docker'
args: ['run',
'--name', 'abc-model',
'--volume', '/workspace/model:/tmp',
'--env', 'input_model_path=/tmp',
'--env', 'output_model_path=/tmp/processed',
'gcr.io/$PROJECT_ID/model-processor:latest']
id: 'run-model-processor'
The above code works for me most of the time but it has been flaky sometimes when the /workspace/model
is not mounted correctly (cannot detect content under the directory when the image runs). But since it's a sub-dir of /workspace
I assume it's persisted.
Upvotes: 0
Reputation: 1268
The only directory that persists across build steps is the /workspace
directory; see the documentation for further details: https://cloud.google.com/container-builder/docs/api/build-steps.
Upvotes: 2