是否可以在kubectl云构建器中指定入口点?

时间:2019-05-04 08:56:34

标签: docker kubernetes google-cloud-platform google-cloud-build docker-entrypoint

使用docker cloud builder,我可以这样指定bashsh的入口点:

  

cloudbuild.yaml

steps:
  - name: 'gcr.io/cloud-builders/docker'
    id: BuildDockerImages
    entrypoint: /bin/sh
    args:
      - '-c'
      - |
        set -x && \
        ./build_and_push_images.sh
    env:
      - 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'
      - 'CLOUDSDK_CONTAINER_CLUSTER=standard-cluster-1'

但是无论我在kubectl cloud builderbash中指定任何shell程序(shentrypoint),在cloudbuild中都会​​收到以下错误:

Step #2 - "UpdateImages": docker: Error response from daemon: OCI
 runtime create failed: container_linux.go:348: starting container
 process caused "exec: \"sh - '-c' - | set -x && \\\\ echo hi\":
 executable file not found in $PATH": unknown.

这是配置:

  

cloudbuild.yaml

 - name: 'gcr.io/cloud-builders/kubectl'
    id: UpdateImages
    entrypoint: sh # or bash, /bin/sh, /bin/bash
      - '-c'
      - |
        set -x && \
        ./devops/update_k8s_deployment.sh
    env:
      - 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'
      - 'CLOUDSDK_CONTAINER_CLUSTER=standard-cluster-1'

我想念什么吗?为什么我不能指定入口点?我是否需要每次使用其他生成器并安装kubectl?

0 个答案:

没有答案