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 クラウド ビルダーで指定したシェル プログラム (bashまたは) が何であれ、cloudbuildで次のエラーが表示されます。shentrypoint

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