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

docker image build error #136

Open
googs1025 opened this issue Jul 4, 2024 · 5 comments
Open

docker image build error #136

googs1025 opened this issue Jul 4, 2024 · 5 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/support Categorizes issue or PR as a support question. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@googs1025
Copy link
Member

I found an error during the compilation of the Docker image, following the steps in the README documentation.
Is this error because the go version is not forward compatible?

go version: 1.22
k8s version: v1.29.2
ubuntu 22

root@VM-0-8-ubuntu:/home/ubuntu/usage-metrics-collector# docker build . -t usage-metrics-collector:v0.0.0
[+] Building 74.5s (14/18)                                                                                                                                                                             docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                             0.0s
 => => transferring dockerfile: 804B                                                                                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/alpine:3.17                                                                                                                                                   0.7s
 => [internal] load metadata for docker.io/library/golang:1.19                                                                                                                                                   0.7s
 => [internal] load .dockerignore                                                                                                                                                                                0.0s
 => => transferring context: 2B                                                                                                                                                                                  0.0s
 => [build 1/7] FROM docker.io/library/golang:1.19@sha256:3025bf670b8363ec9f1b4c4f27348e6d9b7fec607c47e401e40df816853e743a                                                                                       0.0s
 => [stage-1 1/6] FROM docker.io/library/alpine:3.17@sha256:a6063e988bcd597b4f1f7cfd4ec38402b02edd0c79250f00c9e14dc1e94bebbc                                                                                     0.0s
 => [internal] load build context                                                                                                                                                                                0.0s
 => => transferring context: 63.82kB                                                                                                                                                                             0.0s
 => CACHED [stage-1 2/6] RUN apk --no-cache add curl # install for debugging -- not required to run                                                                                                              0.0s
 => CACHED [build 2/7] WORKDIR /workspace                                                                                                                                                                        0.0s
 => CACHED [build 3/7] COPY go.mod ./                                                                                                                                                                            0.0s
 => CACHED [build 4/7] COPY go.sum ./                                                                                                                                                                            0.0s
 => CACHED [build 5/7] RUN go mod download                                                                                                                                                                       0.0s
 => CACHED [build 6/7] COPY . .                                                                                                                                                                                  0.0s
 => ERROR [build 7/7] RUN make build-docker                                                                                                                                                                     73.7s
------
 > [build 7/7] RUN make build-docker:
18.28 go: no main packages to build
50.67 # sigs.k8s.io/controller-runtime/pkg/cache
50.67 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/cache.go:412:58: fields.Selector does not implement comparable
50.67 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/cache.go:442:20: fields.Selector does not implement comparable
50.67 note: module requires Go 1.20
60.71 # sigs.k8s.io/controller-runtime/pkg/cache
60.71 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/cache.go:412:58: fields.Selector does not implement comparable
60.71 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/cache.go:442:20: fields.Selector does not implement comparable
60.71 note: module requires Go 1.20
73.52 make: *** [Makefile:97: build-docker] Error 1
------
Dockerfile:24
--------------------
  22 |     # Build and test code
  23 |     COPY . .
  24 | >>> RUN make build-docker
  25 |
  26 |     FROM alpine:3.17
--------------------
ERROR: failed to solve: process "/bin/sh -c make build-docker" did not complete successfully: exit code: 2
root@VM-0-8-ubuntu:/home/ubuntu/usage-metrics-collector# go version
go version go1.22.3 linux/amd64
root@VM-0-8-ubuntu:/home/ubuntu/usage-metrics-collector#

root@VM-0-8-ubuntu:/home/ubuntu/usage-metrics-collector# kubectl get node
NAME                     STATUS   ROLES           AGE   VERSION
cluster1-control-plane   Ready    control-plane   27m   v1.29.2
cluster1-worker          Ready    <none>          26m   v1.29.2
cluster1-worker2         Ready    <none>          26m   v1.29.2
root@VM-0-8-ubuntu:/home/ubuntu/usage-metrics-collector# kind version
kind v0.23.0 go1.21.10 linux/amd64
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 4, 2024
@googs1025
Copy link
Member Author

/kind support

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Jul 4, 2024
@googs1025
Copy link
Member Author

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 4, 2024
@googs1025
Copy link
Member Author

/help

@k8s-ci-robot
Copy link
Contributor

@googs1025:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jul 5, 2024
@ehashman
Copy link
Contributor

Have you tried using Go 1.20 to build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/support Categorizes issue or PR as a support question. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants