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.
Clean the Dockerfile
- Loading branch information
Showing
2 changed files
with
6 additions
and
24 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,35 +1,18 @@ | ||
FROM ubuntu:16.04 as buildstage | ||
FROM golang:1.23.4-alpine 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 | ||
RUN apk update && apk add make gcc git curl | ||
|
||
# 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 | ||
ENV GO111MODULE=on | ||
|
||
#Build ipmi_exporter | ||
WORKDIR /$GOPATH/src/github.com/platinasystems/ipmi_exporter | ||
COPY . . | ||
RUN make | ||
RUN make precheck style unused build | ||
RUN mv ipmi_exporter / | ||
|
||
#Copy the ipmi_expoter binary | ||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
FROM --platform=${OS}/${ARCH} alpine:3 | ||
FROM alpine:3 | ||
RUN apk --no-cache add freeipmi | ||
LABEL maintainer="The Prometheus Authors <[email protected]>" | ||
WORKDIR / | ||
|
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