Passing files from Google Cloud Container Builder to Docker build task

前端 未结 3 1726
灰色年华
灰色年华 2021-02-06 07:17

Context

A Ruby on Rails application built with Container Builder destined for App Engine. We require bundler to be able to install dependencies from a p

3条回答
  •  暖寄归人
    2021-02-06 08:06

    I also had to deal with the same problem, instead of copying ssh keys in to Docker files and cleaning up I cloned the repo in to workspace as a cloud build step. Contents in workspace is persisted across builds steps and can be used indocker file during build.

    # Clone git repo.
    - name: 'gcr.io/cloud-builders/git'
      id: git-clone
      args:
      - clone
      - git@github.com:repo.git
      - workspace/repo-clone
      volumes:
      - name: 'ssh'
      path: /root/.ssh
    

    Then in docker file.

    COPY workspace/repo-name build/
    

提交回复
热议问题