forked from prometheus-community/ipmi_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
FROM ubuntu:16.04 as buildstage | ||
|
||
# Install git, curl and build required packages | ||
RUN apt-get update -y && apt-get install -y git curl make gcc tar rsync wget | ||
|
||
# Download Go and install it to /usr/local/go | ||
RUN curl -s https://storage.googleapis.com/golang/go1.19.10.linux-amd64.tar.gz | tar -v -C /usr/local -xz | ||
ENV PATH $PATH:/usr/local/go/bin | ||
|
||
# Enable go modules | ||
ENV GO111MODULE on | ||
RUN go env -w GOPRIVATE=github.com/platinasystems/* | ||
|
||
# Enable access to private github repositories | ||
# Token must be passed with --build-arg GITHUB_TOKEN=<value> | ||
ARG GITHUB_TOKEN | ||
RUN git config --global url."https://$GITHUB_TOKEN:[email protected]/".insteadOf "https://github.com/" | ||
|
||
# Populate the module cache based on the go.{mod,sum} files for ipmi_exporter | ||
COPY go.mod go.mod | ||
RUN go mod download | ||
|
||
#Build ipmi_exporter | ||
WORKDIR /$GOPATH/src/github.com/platinasystems/ipmi_exporter | ||
COPY . . | ||
RUN make | ||
RUN mv ipmi_exporter / | ||
|
||
#Copy the ipmi_expoter binary | ||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
FROM --platform=${OS}/${ARCH} alpine:3 | ||
RUN apk --no-cache add freeipmi | ||
LABEL maintainer="The Prometheus Authors <[email protected]>" | ||
|
||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
COPY .build/${OS}-${ARCH}/ipmi_exporter /bin/ipmi_exporter | ||
WORKDIR / | ||
COPY --from=buildstage /ipmi_exporter / | ||
|
||
EXPOSE 9290 | ||
USER nobody | ||
ENTRYPOINT [ "/bin/ipmi_exporter" ] | ||
ENTRYPOINT [ "/ipmi_exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
projectName=ipmi-exporter | ||
version=stable | ||
language=go | ||
dockerfilePath= |