In Google Container Builder, is the `dir:` mapped?

3/23/2017

I have two containers, the first modifies some files in the repo and the second has those files ADDed 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.

-- Simon I
google-cloud-platform
google-container-registry
google-kubernetes-engine

2 Answers

11/26/2019
- 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.

-- Zhang Wen
Source: StackOverflow

3/23/2017

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.

-- David Bendory
Source: StackOverflow