docker - 如何在谷歌云构建中将参数传递给 docker run
问题描述
我正在尝试使用 GCB 运行柏树管道,但是在 docker 内运行时它会崩溃。
如此处所述,此问题的修复方法是使用--ipc=host
.
但是查看文档,我找不到如何在 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']
解决方案
你可以尝试这样做。我不知道它是否会起作用,因为您在容器中运行容器,但请尝试您的最新步骤
- 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
推荐阅读
- r - R regex 正则表达式:从字符串中的逗号分隔值创建字符列表
- scheduling - 安排 Autorep 命令每天运行
- amazon-web-services - AWS EKS Workshop 显示许多部分的访问被拒绝
- php - 为什么我的变量的值已经从函数中改变而没有在 OOP 中通过引用显式传递?
- javascript - 当页面没有被关注时,如何使页面不入睡?
- go - 从 int32 转换为枚举的惯用方式
- python - Django - 配置不当
- android-studio - 无法从 pubspec.yaml 导入“包”
- python - AttributeError:“dict”对象没有属性“sort_values”
- scala - 如何在 Scala 中控制未来的并发?