Description
Describe the bug
Trying to use Cloud Run to deploy this repo with Buildpack, build fails saying "the --mount option requires BuildKit."
Affected version
Tag v0.5.0
Steps to reproduce the behavior
Point to repo forked from this repo and updated to tag v0.5.0, try deploying to Cloud Run.
Editing Dockerfile to include this directive indicated by docs for BuildKit results in a failure farther down the line where the error is "no go files in /workspace."
Expected vs actual behavior
Expect it to build, build fails.
Logs
With v0.5.0:
1 | Already have image (with digest): gcr.io/cloud-builders/docker
2 | Sending build context to Docker daemon 533kB
3 | Step 1/10 : FROM golang:1.24.3-alpine AS build
4 | 1.24.3-alpine: Pulling from library/golang
5 | fe07684b16b8: Already exists
6 | 965f7aff83c4: Pulling fs layer
7 | 92b00dc8dfba: Pulling fs layer
8 | 87ee4818046b: Pulling fs layer
9 | 4f4fb700ef54: Pulling fs layer
10 | 4f4fb700ef54: Waiting
11 | 87ee4818046b: Verifying Checksum
12 | 87ee4818046b: Download complete
13 | 965f7aff83c4: Verifying Checksum
14 | 965f7aff83c4: Download complete
15 | 4f4fb700ef54: Verifying Checksum
16 | 4f4fb700ef54: Download complete
17 | 965f7aff83c4: Pull complete
18 | 92b00dc8dfba: Verifying Checksum
19 | 92b00dc8dfba: Download complete
20 | 92b00dc8dfba: Pull complete
21 | 87ee4818046b: Pull complete
22 | 4f4fb700ef54: Pull complete
23 | Digest: sha256:b4f875e650466fa0fe62c6fd3f02517a392123eea85f1d7e69d85f780e4db1c1
24 | Status: Downloaded newer image for golang:1.24.3-alpine
25 | ---> ee6ed942a4ad
26 | Step 2/10 : ARG VERSION="dev"
27 | ---> Running in 5280ceacab1b
28 | Removing intermediate container 5280ceacab1b
29 | ---> c24de8bb4462
30 | Step 3/10 : WORKDIR /build
31 | ---> Running in a4b1fc1a0ab1
32 | Removing intermediate container a4b1fc1a0ab1
33 | ---> 0abb94d6732b
34 | Step 4/10 : RUN --mount=type=cache,target=/var/cache/apk apk add git
35 | the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled
With BuildKit enabled in Dockerfile:
starting build "9895d622-5b4b-4d3b-84c5-f33e29702aea"
2 |
3 | FETCHSOURCE
4 | hint: Using 'master' as the name for the initial branch. This default branch name
5 | hint: is subject to change. To configure the initial branch name to use in all
6 | hint: of your new repositories, which will suppress this warning, call:
7 | hint:
8 | hint: git config --global init.defaultBranch
9 | hint:
10 | hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
11 | hint: 'development'. The just-created branch can be renamed via this command:
12 | hint:
13 | hint: git branch -m
14 | Initialized empty Git repository in /workspace/.git/
15 | From https://github.com/AtA-Systems/github-mcp-server
16 | * branch 401c14b -> FETCH_HEAD
17 | HEAD is now at 401c14b Update Dockerfile with buildkit directive
18 | GitCommit:
19 | 401c14b
20 | BUILD
21 | Starting Step #0 - "Buildpack"
22 | Pulling image: gcr.io/k8s-skaffold/pack
23 | Using default tag: latest
24 | latest: Pulling from k8s-skaffold/pack
25 | 396c31837116: Pulling fs layer
26 | 9776b10d5c8c: Pulling fs layer
27 | 52cb9ac3197f: Pulling fs layer
28 | 9776b10d5c8c: Verifying Checksum
29 | 9776b10d5c8c: Download complete
30 | 396c31837116: Verifying Checksum
31 | 396c31837116: Download complete
32 | 52cb9ac3197f: Verifying Checksum
33 | 396c31837116: Pull complete
34 | 52cb9ac3197f: Pull complete
35 | Digest: sha256:221c0c0d9a90f46f108bb888a1da9e99c82ff631e8b1c63b0223ea951752bd53
36 | Status: Downloaded newer image for gcr.io/k8s-skaffold/pack:latest
37 | latest: Pulling from buildpacks/builder
38 | Digest: sha256:ae835baac2946b6251f38d41a538809b2f3b866600ebebed67783102811b89ee
39 | Status: Downloaded newer image for gcr.io/buildpacks/builder:latest
40 | latest: Pulling from buildpacks/google-22/run
41 | Digest: sha256:dbd742d70aa15e60bd220548eb0298481607dc28c19b3faef8b57e9008f49353
42 | Status: Downloaded newer image for gcr.io/buildpacks/google-22/run:latest
43 | 0baecf37abee: Pulling fs layer
44 | bfb59b82a9b6: Pulling fs layer
45 | efa9d1d5d3a2: Pulling fs layer
46 | a62778643d56: Pulling fs layer
47 | 7c12895b777b: Pulling fs layer
48 | 3214acf345c0: Pulling fs layer
49 | 5664b15f108b: Pulling fs layer
50 | 0bab15eea81d: Pulling fs layer
51 | 4aa0ea1413d3: Pulling fs layer
52 | da7816fa955e: Pulling fs layer
53 | 9aee425378d2: Pulling fs layer
54 | 8efdac1741f0: Pulling fs layer
55 | a62778643d56: Waiting
56 | 7c12895b777b: Waiting
57 | 3214acf345c0: Waiting
58 | 5664b15f108b: Waiting
59 | 0bab15eea81d: Waiting
60 | 4aa0ea1413d3: Waiting
61 | da7816fa955e: Waiting
62 | 9aee425378d2: Waiting
63 | 8efdac1741f0: Waiting
64 | 5664b15f108b: Verifying Checksum
65 | 5664b15f108b: Download complete
66 | 4aa0ea1413d3: Verifying Checksum
67 | 4aa0ea1413d3: Download complete
68 | 5664b15f108b: Pull complete
69 | 0bab15eea81d: Verifying Checksum
70 | 0bab15eea81d: Download complete
71 | 0bab15eea81d: Pull complete
72 | 4aa0ea1413d3: Pull complete
73 | da7816fa955e: Verifying Checksum
74 | da7816fa955e: Download complete
75 | 9aee425378d2: Verifying Checksum
76 | 9aee425378d2: Download complete
77 | da7816fa955e: Pull complete
78 | 9aee425378d2: Pull complete
79 | 8efdac1741f0: Verifying Checksum
80 | 8efdac1741f0: Download complete
81 | 8efdac1741f0: Pull complete
82 | Digest: sha256:3274fe28594f484240fc3f17e46b7b45e304830e544dcdd82ce19472d159ef71
83 | Status: Downloaded newer image for buildpacksio/lifecycle:0.20.5
84 | ===> ANALYZING
85 | [analyzer] Image with name "europe-west1-docker.pkg.dev/resonant-sunset-463921-b6/cloud-run-source-deploy/github-mcp-server/github-mcp-server:401c14bcc7d51484fe6edb7627c1164e4e34c2f5" not found
86 | ===> DETECTING
87 | [detector] target distro name/version labels not found, reading /etc/os-release file
88 | [detector] 4 of 6 buildpacks participating
89 | [detector] google.go.runtime 0.9.1
90 | [detector] google.go.gomod 0.9.0
91 | [detector] google.go.build 0.9.0
92 | [detector] google.utils.label-image 0.0.2
93 | ===> RESTORING
94 | ===> BUILDING
95 | [builder] target distro name/version labels not found, reading /etc/os-release file
96 | [builder] === Go - Runtime (google.go.runtime@0.9.1) ===
97 | [builder] 2025/06/24 23:47:50 [DEBUG] GET https://go.dev/dl/?mode=json
98 | [builder] ***** CACHE MISS: "go"
99 | [builder] Installing Go v1.24.4.
100 | [builder] 2025/06/24 23:47:50 [DEBUG] GET https://dl.google.com/go/go1.24.4.linux-amd64.tar.gz
101 | [builder] === Go - Gomod (google.go.gomod@0.9.0) ===
102 | [builder] ***** CACHE MISS: "gopath"
103 | [builder] --------------------------------------------------------------------------------
104 | [builder] Running "go mod download (GOPATH=/layers/google.go.gomod/gopath GO111MODULE=on GOPROXY=https://proxy.golang.org\|direct)"
105 | [builder] Done "go mod download (GOPATH=/layers/google.go.gomod/gopath GO111..." (1.929321196s)
106 | [builder] === Go - Build (google.go.build@0.9.0) ===
107 | [builder] --------------------------------------------------------------------------------
108 | [builder] Running "go list -f {{if eq .Name "main"}}{{.Dir}}{{end}} ./..."
109 | [builder] /workspace/cmd/github-mcp-server
110 | [builder] /workspace/cmd/mcpcurl
111 | [builder] Done "go list -f {{if eq .Name "main"}}{{.Dir}}{{end}} ./..." (487.027498ms)
112 | [builder] --------------------------------------------------------------------------------
113 | [builder] Running "go build -o /layers/google.go.build/bin/main . (GOCACHE=/layers/google.go.build/gocache)"
114 | [builder] no Go files in /workspace
115 | [builder] Done "go build -o /layers/google.go.build/bin/main . (GOCACHE=/lay..." (7.344961ms)
116 | [builder] Tip: "GOOGLE_BUILDABLE" env var configures which Go package is built. Default is '.'
117 | [builder] --------------------------------------------------------------------------------
118 | [builder] failed to build: (error ID: 721b15b4):
119 | [builder] no Go files in /workspace
120 | [builder] --------------------------------------------------------------------------------
121 | [builder] Sorry your project couldn't be built.
122 | [builder] Our documentation explains ways to configure Buildpacks to better recognise your project:
123 | [builder] -> https://cloud.google.com/docs/buildpacks/overview
124 | [builder] If you think you've found an issue, please report it:
125 | [builder] -> https://github.com/GoogleCloudPlatform/buildpacks/issues/new
126 | [builder] --------------------------------------------------------------------------------
127 | [builder] ERROR: failed to build: exit status 1
128 | ERROR: failed to build: executing lifecycle. This may be the result of using an untrusted builder: failed with status code: 51
129 | Finished Step #0 - "Buildpack"
130 | ERROR
131 | ERROR: build step 0 "gcr.io/k8s-skaffold/pack" failed: step exited with non-zero status: 1