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 based build fails: [email protected] requires go >= 1.22.6 (running go 1.21.10) #45

Open
rmi1974 opened this issue Aug 21, 2024 · 1 comment

Comments

@rmi1974
Copy link

rmi1974 commented Aug 21, 2024

Hello folks,

when trying to build with buildx docker container it fails:

 => ERROR [linux/amd64 builder 2/4] RUN go install github.com/sberk42/fritzbox_exporter@latest     && mkdir /app     && mv /go/bin/fritzbox_exporter /app                                0.8s
 => CACHED [linux/arm64 runtime-image 2/4] RUN mkdir /app     && addgroup -S -g 1000 fritzbox     && adduser -S -u 1000 -G fritzbox fritzbox     && chown -R fritzbox:fritzbox /app      0.0s
 => CACHED [linux/arm64 runtime-image 3/4] WORKDIR /app                                                                                                                                  0.0s
 => CANCELED [linux/arm64 builder 2/4] RUN go install github.com/sberk42/fritzbox_exporter@latest     && mkdir /app     && mv /go/bin/fritzbox_exporter /app                             0.9s
------                                                                                                                                                                                        
 > [linux/amd64 builder 2/4] RUN go install github.com/sberk42/fritzbox_exporter@latest     && mkdir /app     && mv /go/bin/fritzbox_exporter /app:                                           
0.511 go: downloading github.com/sberk42/fritzbox_exporter v0.0.0-20240820210122-780fb64b5bf9                                                                                                 
0.577 go: github.com/sberk42/fritzbox_exporter@latest: github.com/sberk42/[email protected] requires go >= 1.22.6 (running go 1.21.10; GOTOOLCHAIN=local)
------
Dockerfile:5
--------------------
   4 |     FROM golang:1.21-alpine3.18 AS builder
   5 | >>> RUN go install github.com/sberk42/fritzbox_exporter@latest \
   6 | >>>     && mkdir /app \
   7 | >>>     && mv /go/bin/fritzbox_exporter /app
   8 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c go install github.com/sberk42/fritzbox_exporter@latest     && mkdir /app     && mv /go/bin/fritzbox_exporter /app" did not complete successfully: exit code: 1

This broke it:

d4568d8

You need to update the Dockerfile as well for people using Docker to build stuff.

https://hub.docker.com/_/golang/tags?page=1&page_size=&name=alpine&ordering=

Something like this:

diff --git a/Dockerfile b/Dockerfile
index acb934d..1fe5e71 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
 # syntax=docker/dockerfile:1
 
 # Build Image
-FROM golang:1.21-alpine3.18 AS builder
+FROM golang:1.22.6-alpine3.20 AS builder
 RUN go install github.com/sberk42/fritzbox_exporter@latest \
     && mkdir /app \
     && mv /go/bin/fritzbox_exporter /app

Regards

@sberk42
Copy link
Owner

sberk42 commented Aug 21, 2024

thanks for the hint - just updated the Dockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants