Is it possible to specify an entrypoint in the kubectl cloud builder?

5/4/2019

With the docker cloud builder I am able to specify an entry point to bash or sh like so:

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'

But whatever shell program (bash or sh) I specify in the entrypoint of the kubectl cloud builder, I receive the following error in 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.

This being the config:

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'

Am I missing something? Why am I not able to specify an entry point? Do I need to use another builder and install kubectl everytime myself?

-- Tom
docker
docker-entrypoint
google-cloud-build
google-cloud-platform
kubernetes

0 Answers