title: Google Cloud Build Trigger failing with "ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1"
body: <p>I am trying to setup continuous deployment of my golang backend using the <a href="https://cloud.google.com/cloud-build/docs/deploying-builds/deploy-cloud-run#building_and_deploying_a_container" rel="nofollow noreferrer">Google documentation</a>, but when my trigger fires, it fails with the following error:</p>
  
  <pre><code>starting build "eba3ce39-caad-43f0-a255-0a3cacec4913"
  
  FETCHSOURCE
  Initialized empty Git repository in /workspace/.git/
  From https://source.developers.google.com/p/my-porject/r/github_myusername_myproject.com
   * branch            660796f575bae6860d6f96df60cfd631a730c3ae -&gt; FETCH_HEAD
  HEAD is now at 660796f cloudbuild.yaml
  BUILD
  Starting Step #0
  Step #0: Already have image (with digest): gcr.io/cloud-builders/docker
  Step #0: unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/Dockerfile: no such file or directory
  Finished Step #0
  ERROR
  ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
  </code></pre>
  
  <p>My project file structure looks like:</p>
  
  <pre><code>project
      frontend
      backend
          main.go
          cloudbuild.yaml
          Dockerfile
  </code></pre>
  
  <p>where my cloudbuild.yaml looks like:</p>
  
  <pre><code>steps:
    # Build the container image
    - name: "gcr.io/cloud-builders/docker"
      args:
        [
          "build",
          "-t",
          "gcr.io/my-project/github.com/username/project.com:$COMMIT_SHA",
          ".",
        ]
    # Push the image to Container Registry
    - name: "gcr.io/cloud-builders/docker"
      args:
        [
          "push",
          "gcr.io/my-project/github.com/username/project.com:$COMMIT_SHA",
        ]
    # Deploy image to Cloud Run
    - name: "gcr.io/cloud-builders/gcloud"
      args:
        - "run"
        - "deploy"
        - "[SERVICE_NAME]"
        - "--image"
        - "gcr.io/my-project/github.com/username/project.com:$COMMIT_SHA"
        - "--region"
        - "us-central1"
        - "--platform"
        - "managed"
  images:
    - gcr.io/my-project/github.com/username/project.com
  </code></pre>
  
  <p>and my Dockerfile looks like</p>
  
  <pre><code># Use the official Golang image to create a build artifact.
  # This is based on Debian and sets the GOPATH to /go.
  # https://hub.docker.com/_/golang
  FROM golang:1.13 as builder
  
  # Create and change to the app directory.
  WORKDIR /app
  
  # Retrieve application dependencies.
  # This allows the container build to reuse cached dependencies.
  COPY go.* ./
  RUN go mod download
  
  # Copy local code to the container image.
  COPY . ./
  
  # Build the binary.
  RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server
  
  # Use the official Alpine image for a lean production container.
  # https://hub.docker.com/_/alpine
  # https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
  FROM alpine:3
  RUN apk add --no-cache ca-certificates
  
  # Copy the binary to the production image from the builder stage.
  COPY --from=builder /app/server /server
  
  # Run the web service on container startup.
  CMD ["/server"]
  </code></pre>
  
  <p>I got the Dockerfile from <a href="https://cloud.google.com/run/docs/quickstarts/build-and-deploy" rel="nofollow noreferrer">Quickstart: Build and Deploy
  </a>.</p>