Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在google cloud build中将参数传递给docker run_Docker_Google Cloud Platform_Cypress_Google Cloud Build_Cloudbuild.yaml - Fatal编程技术网

如何在google cloud build中将参数传递给docker run

如何在google cloud build中将参数传递给docker run,docker,google-cloud-platform,cypress,google-cloud-build,cloudbuild.yaml,Docker,Google Cloud Platform,Cypress,Google Cloud Build,Cloudbuild.yaml,我试图使用GCB运行cypress管道,但在docker内部运行时它崩溃了 如前所述,解决此问题的方法是使用--ipc=host运行docker 但是查看文档,我找不到如何在GCB中将参数传递给docker run 有人能帮我吗 管道是 步骤: #安装节点单元模块 -名称:“gcr.io/cloud builders/Thread” 参数:['install'] #林特JS -名称:“gcr.io/cloud builders/Thread” 参数:['lint'] #单元测试 -名称:“gcr

我试图使用GCB运行cypress管道,但在docker内部运行时它崩溃了

如前所述,解决此问题的方法是使用
--ipc=host
运行docker

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

有人能帮我吗

管道是

步骤:
#安装节点单元模块
-名称:“gcr.io/cloud builders/Thread”
参数:['install']
#林特JS
-名称:“gcr.io/cloud builders/Thread”
参数:['lint']
#单元测试
-名称:“gcr.io/cloud builders/Thread”
参数:['test:unit','--coverage']
#E2E测试(需要cypress依赖项,请参阅https://github.com/GoogleCloudPlatform/cloud-builders-community/pull/485)
-名称:“gcr.io/$PROJECT\u ID/cypress依赖项”
参数:['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

请看:你能分享你的管道吗?@guillaumeblaquiere在主帖子中添加