sberk42/fritzbox_exporter

Unable to build docker image due to go error

Closed this issue · 4 comments

Hi,

first of all: many thanks for this great exporter :)

Since several days I'm facing the following error during docker build after cloning the git repo:

Sending build context to Docker daemon 1.134MB
Step 1/17 : FROM golang:alpine3.15 AS builder
alpine3.15: Pulling from library/golang
dfd6a1b07255: Pulling fs layer
331b3631dc9d: Pulling fs layer
ac904122a781: Pulling fs layer
abd83326c913: Pulling fs layer
c701d215bbd6: Pulling fs layer
abd83326c913: Waiting
c701d215bbd6: Waiting
ac904122a781: Verifying Checksum
ac904122a781: Download complete
331b3631dc9d: Verifying Checksum
331b3631dc9d: Download complete
dfd6a1b07255: Verifying Checksum
dfd6a1b07255: Download complete
c701d215bbd6: Verifying Checksum
c701d215bbd6: Download complete
dfd6a1b07255: Pull complete
331b3631dc9d: Pull complete
ac904122a781: Pull complete
abd83326c913: Verifying Checksum
abd83326c913: Download complete
abd83326c913: Pull complete
c701d215bbd6: Pull complete
Digest: sha256:6fd04df1b7ba6253a09b4bd3f37cc1fb69903a60209ef959485328b1c2902327
Status: Downloaded newer image for golang:alpine3.15
---> e2757ead23b6
Step 2/17 : RUN go get github.com/sberk42/fritzbox_exporter/ && mkdir /app && mv /go/bin/fritzbox_exporter /app
---> Running in 6eac3a97cdc4
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
The command '/bin/sh -c go get github.com/sberk42/fritzbox_exporter/ && mkdir /app && mv /go/bin/fritzbox_exporter /app' returned a non-zero code: 1

Could you please fix that ?

Have a day :)

Kind regards

same issue, you find some solutions?

nope because I dont have any go knowledge :(

switched Dockerfile to use go install, this should fix it

yep, its working. thanks :)