1

使用docker cloud builder我可以指定一个入口点,bash或者sh像这样:

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 builder中指定什么 shell 程序(bashsh),我都会在 cloudbuild 中收到以下错误:entrypoint

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 吗?

4

0 回答 0