-
Notifications
You must be signed in to change notification settings - Fork 807
Closed
Description
Hi,
the build process with docker is broken, a few weeks ago it was still working.
There might be some dependencies that are not pinned to a specific version?
Steps to reproduce
git clone [email protected]:justwatchcom/elasticsearch_exporter.git
checkout elasticsearch_exporter
docker build -t elasticsearch_exporter .
Output
Sending build context to Docker daemon 2.907MB
Step 1/9 : FROM quay.io/prometheus/golang-builder as builder
---> 7c3ffa91adec
Step 2/9 : ADD . /go/src/github.com/justwatchcom/elasticsearch_exporter
---> 0cf1d6d5bf2c
Step 3/9 : WORKDIR /go/src/github.com/justwatchcom/elasticsearch_exporter
---> Running in 2193e46e7f2a
Removing intermediate container 2193e46e7f2a
---> d70124ffd789
Step 4/9 : RUN make
---> Running in 9444ac565329
go: cannot find main module, but found vendor/vendor.json in /go/src/github.com/justwatchcom/elasticsearch_exporter
to create a module there, run:
go mod init
>> formatting code
go: cannot find main module, but found vendor/vendor.json in /go/src/github.com/justwatchcom/elasticsearch_exporter
to create a module there, run:
go mod init
make: *** [Makefile:37: format] Error 1
The command '/bin/sh -c make' returned a non-zero code: 2
I tried to pin the quay.io/prometheus/golang-builder base image to a version I knew that worked previously. But that did not solve the problem. Just other issues later on in the build process.
Changing the Dockerfile:
FROM quay.io/prometheus/golang-builder@sha256:03a4847c55ecf967a1403393a06ae611498c2aec4b434087ce363127d58a17b0 as builder
Again, running docker build -t elasticsearch_exporter .:
Sending build context to Docker daemon 2.907MB
Step 1/9 : FROM quay.io/prometheus/golang-builder@sha256:03a4847c55ecf967a1403393a06ae611498c2aec4b434087ce363127d58a17b0 as builder
---> 8d8f526f0a64
Step 2/9 : ADD . /go/src/github.com/justwatchcom/elasticsearch_exporter
---> ecf5974666a6
Step 3/9 : WORKDIR /go/src/github.com/justwatchcom/elasticsearch_exporter
---> Running in d8c5f445cc70
Removing intermediate container d8c5f445cc70
---> a351303054ca
Step 4/9 : RUN make build
---> Running in 566dfb00711c
cannot find package "github.com/google/go-github/v25/github" in any of:
/usr/local/go/src/github.com/google/go-github/v25/github (from $GOROOT)
/go/src/github.com/google/go-github/v25/github (from $GOPATH)
make: *** [Makefile:66: promu] Error 1
The command '/bin/sh -c make build' returned a non-zero code: 2
Anyone an idea how to fix that?
We rely on building the dockerfile ourselves, because we need the latest changes in master that are not available in the latest docker image (v1.1.0).
Metadata
Metadata
Assignees
Labels
No labels