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 won't build #7

Open
piotrkochan opened this issue Sep 8, 2019 · 4 comments
Open

Docker image won't build #7

piotrkochan opened this issue Sep 8, 2019 · 4 comments

Comments

@piotrkochan
Copy link

sudo docker build -t test/sensor-exporter .
Sending build context to Docker daemon  12.56MB
Step 1/7 : FROM golang:1.8
 ---> 0d283eb41a92
Step 2/7 : ADD sensor-exporter /go/src/github.com/ncabatoff/sensor-exporter
 ---> Using cache
 ---> 004371b0cb2a
Step 3/7 : RUN apt-get update
 ---> Using cache
 ---> 8f773ce96376
Step 4/7 : RUN apt-get --yes install libsensors4-dev
 ---> Using cache
 ---> faf57d0558fd
Step 5/7 : RUN go get github.com/ncabatoff/gosensors github.com/prometheus/client_golang/prometheus && go install github.com/ncabatoff/sensor-exporter
 ---> Running in 12d2da34fabf
# github.com/ncabatoff/sensor-exporter
src/github.com/ncabatoff/sensor-exporter/main.go:69: undefined: prometheus.Handler
The command '/bin/sh -c go get github.com/ncabatoff/gosensors github.com/prometheus/client_golang/prometheus && go install github.com/ncabatoff/sensor-exporter' returned a non-zero code: 2
@piotrkochan
Copy link
Author

probably similar to jonnenauha/prometheus_varnish_exporter#45

@piotrkochan
Copy link
Author

but this Dockerfile works just great https://hub.docker.com/r/amkay/sensor-exporter/dockerfile 👍

@Redsandro
Copy link

Same issue.

Step 5/7 : RUN go get github.com/ncabatoff/gosensors github.com/prometheus/client_golang/prometheus && go install github.com/ncabatoff/sensor-exporter

 ---> Running in 1190ddffcf9a

package github.com/cespare/xxhash/v2: cannot find package "github.com/cespare/xxhash/v2" in any of:
	/usr/local/go/src/github.com/cespare/xxhash/v2 (from $GOROOT)
	/go/src/github.com/cespare/xxhash/v2 (from $GOPATH)

ERROR: Service 'sensor-exporter' failed to build: The command '/bin/sh -c go get github.com/ncabatoff/gosensors github.com/prometheus/client_golang/prometheus && go install github.com/ncabatoff/sensor-exporter' returned a non-zero code: 1

@piotrkochan commented:

but this Dockerfile works just great https://hub.docker.com/r/amkay/sensor-exporter/dockerfile +1

That one is 3 years old.

@Redsandro
Copy link

The base image is too old. It needs to be FROM golang:1.9 or higher.

I would create a simple PR, but then a new error pops up:

src/github.com/ncabatoff/sensor-exporter/main.go:69:28: undefined: prometheus.Handler

Not sure how to use this properly @ncabatoff

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