I’m a Docker/Cloud Build noob.
The build section (Step 2) of my cloudbuild.yml file is pretty much straight out of the examples:
# Docker Build
- name: "gcr.io/cloud-builders/docker"
id: Docker Build
args: [
"build",
"--tag",
"us-kata9-docker.pkg.dev/<project>/<repo>/<image>:latest",
# "--file=/workspace/Dockerfile",
".",
]
The step fails with:
Starting Step #2 - "Docker Build"
Step #2 - "Docker Build": Already have image (with digest): gcr.io/cloud-builders/docker
Step #2 - "Docker Build": unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/Dockerfile: no such file or directory
Finished Step #2 - "Docker Build"
ERROR
ERROR: build step 2 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
------------------------------------------------------------------------------------------------------------------------
BUILD FAILURE: Build step failure: build step 2 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
ERROR: (gcloud.builds.submit) build br-549 completed with status "FAILURE"
I have tried specifying the path using the --file
switch (see commented bit in yaml
snippet above) and putting the path /workspace
as the positional argument.
Here’s where the noob aspect rears it’s head: I really don’t know whether my error is my fault or not. Am I meant to somehow provide a Dockerfile
to Cloud Build? From what I understand, cloudbuild.yaml
handles everything for the process of building and deploying an image. I expected no other configuration or scripts outside of cloudbuild.yaml
to be required. I have already deployed my python
packages to the “Artifact Registry (which the preceeding steps seem to find with no problem.)
1