【问题标题】:How to pass parameters to docker run in google cloud build如何在谷歌云构建中将参数传递给 docker run
【发布时间】:2021-05-15 14:04:57
【问题描述】:

我正在尝试使用 GCB 运行 cypress 管道,但在 docker 中运行时它会崩溃。

here 所述,此问题的修复方法是使用--ipc=host 运行docker。

但是查看文档,我找不到如何在 GCB 中将参数传递给 docker run。

谁能帮帮我?

管道是

steps:
# Install node_modules
- name: 'gcr.io/cloud-builders/yarn'
  args: ['install']
# Lint JS
- name: 'gcr.io/cloud-builders/yarn'
  args: ['lint']
# Unit tests
- name: 'gcr.io/cloud-builders/yarn'
  args: ['test:unit', '--coverage']
# E2E tests (cypress dependencies required, see https://github.com/GoogleCloudPlatform/cloud-builders-community/pull/485)
- name: 'gcr.io/$PROJECT_ID/cypress-dependencies'
  args: ['test:e2e', '--headless', '--config', 'video=false']

【问题讨论】:

标签: docker google-cloud-platform cypress google-cloud-build cloudbuild.yaml


【解决方案1】:

您可以尝试这样做。我不知道它是否会起作用,因为您在容器中运行容器,但请尝试您的最新步骤

  - name: gcr.io/cloud-builders/docker
    entrypoint: 'bash'
    args:
      - -c
      - |
         docker run --ipc=host gcr.io/$PROJECT_ID/cypress-dependencies \
            test:e2e --headless --config video=false

【讨论】:

    猜你喜欢
    • 2020-07-08
    • 2019-05-01
    • 2015-12-20
    • 1970-01-01
    • 2019-06-25
    • 1970-01-01
    • 1970-01-01
    • 2011-01-13
    • 1970-01-01
    相关资源
    最近更新 更多