Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't compile #3173

Open
sid-occrp opened this issue Nov 11, 2024 · 1 comment
Open

can't compile #3173

sid-occrp opened this issue Nov 11, 2024 · 1 comment
Labels
type: bug Something isn't working

Comments

@sid-occrp
Copy link

Description

I'm trying to build the docker container executing ´docker build -t clutch:latest .´

Expected Behavior

The build should complete successfully.

Actual Behavior

=> ERROR [gobuild 7/7] RUN make backend-with-assets                                                                                                                                                      0.2s
------
 > [gobuild 7/7] RUN make backend-with-assets:
0.201 /go/src/github.com/lyft/clutch
0.201 Running pre-flight checks...
0.213 Pre-flight checks satisfied!
0.213 cd backend && go run cmd/assets/generate.go ../frontend/packages/app/build && go build -tags withAssets -o ../build/clutch -ldflags="-X main.version=0.0.0"
0.219 go: errors parsing go.mod:
0.219 /go/src/github.com/lyft/clutch/backend/go.mod:3: invalid go version '1.23.0': must match format 1.23
0.220 make: *** [Makefile:47: backend-with-assets] Error 1
------
Dockerfile:19
--------------------
  17 |     COPY --from=nodebuild ./frontend/packages/app/build ./frontend/packages/app/build/
  18 |
  19 | >>> RUN make backend-with-assets
  20 |
  21 |     # Copy binary to final image.
--------------------
ERROR: failed to solve: process "/bin/sh -c make backend-with-assets" did not complete successfully: exit code: 2

I've tried modifying the go.mod to go 1.23 but still the build fail with:

87.75 go: downloading github.com/emicklei/go-restful/v3 v3.11.0
90.75 /go/pkg/mod/k8s.io/[email protected]/pkg/util/sets/set.go:20:2: package cmp is not in GOROOT (/usr/local/go/src/cmp)
90.75 note: imported by a module that requires go 1.22
90.76 make: *** [Makefile:47: backend-with-assets] Error 1
------
Dockerfile:19
--------------------
  17 |     COPY --from=nodebuild ./frontend/packages/app/build ./frontend/packages/app/build/
  18 |
  19 | >>> RUN make backend-with-assets
  20 |
  21 |     # Copy binary to final image.
--------------------
ERROR: failed to solve: process "/bin/sh -c make backend-with-assets" did not complete successfully: exit code: 2

Version
2a2f4fe, current HEAD

@sid-occrp sid-occrp added the type: bug Something isn't working label Nov 11, 2024
@samuel-gamelin
Copy link

The following Dockerfile changes worked for me:

diff --git a/Dockerfile b/Dockerfile
index f4b0aec6..4553de93 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@ COPY Makefile .
 RUN make frontend
 
 # Backend build.
-FROM golang:1.20.5-buster as gobuild
+FROM golang:1.23.0-bookworm as gobuild
 WORKDIR /go/src/github.com/lyft/clutch
 COPY ./backend ./backend
 COPY ./tools/preflight-checks.sh ./tools/preflight-checks.sh
@@ -19,7 +19,7 @@ COPY --from=nodebuild ./frontend/packages/app/build ./frontend/packages/app/buil
 RUN make backend-with-assets
 
 # Copy binary to final image.
-FROM gcr.io/distroless/base-debian10
+FROM gcr.io/distroless/base-debian12
 COPY --from=gobuild /go/src/github.com/lyft/clutch/build/clutch /
 COPY backend/clutch-config.yaml /
 CMD ["/clutch"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants