Search code examples
containersgoogle-cloud-builddocker-for-windows

Google Cloud Build Windows Builder Error "The system cannot find the path specified"


I am trying to implement automatic deployments for my Windows Kubernetes container app. I'm following instructions from Google's windows-builder. The trigger completes without an explicit error, but it doesn't initiate the docker build & push. No update has been made in Container Registry. The closest thing I can find to an error message is "The system cannot find the path specified." Screenshot below:

enter image description here

The container, gcr.io/[my-project-id]/windows-builder, definitely exists, and it's located in the same GCP project as the Cloud Build trigger, just as the windows-builder documentation commanded.

I'm guessing that it's unable to find either my build.ps1 file or my worker Dockerfile. I can't understand why, though. I structured my code based on Google's docker-windows example. Here is my repository file structure:

repository
   cloud build.yaml
   builder.ps1
   worker
      Dockerfile

Here is my cloudbuild.yaml:

steps:
# WORKER
- name: 'gcr.io/[my-project-id]/windows-builder'
  args: [ '--create-external-ip', 'true', '--command', 'powershell.exe -file build.ps1' ]

# OPTIONS
options:
  logging: CLOUD_LOGGING_ONLY

Here is my builder.ps1:

docker build -t gcr.io/[my-project-id]/test-worker ./worker;
if ($?) {
  docker push gcr.io/[my-project-id]/test-worker;
}

Here is my worker Dockerfile:

FROM gcr.io/[my-project-id]/test-windows-node-base:onbuild

Does anybody know what I'm doing wrong here? Any help would be appreciated.


Solution

  • I figured it out. I removed the "true" argument for my create-external-ip flag from the cloudbuild.yaml command and that did the trick. Working file is below.

    steps:
    # WORKER
    - name: 'gcr.io/[my-project-id]/windows-builder'
      args: [ '--create-external-ip', '--command', 'powershell.exe -file build.ps1' ]
    
    # OPTIONS
    options:
      logging: CLOUD_LOGGING_ONLY