Skip to content

Commit 928f441

Browse files
author
Dmitrii Ermakov
committed
Alpine based container image
1 parent e54c52f commit 928f441

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Dockerfile.Alpine-builder

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM golang:1.18.1-alpine3.15 AS builder
2+
3+
LABEL maintainer="Jennings Liu <[email protected]>"
4+
5+
ARG ARCH=amd64
6+
7+
ENV GOROOT /usr/local/go
8+
ENV GOPATH /go
9+
ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
10+
ENV GO_VERSION 1.18.1
11+
ENV GO111MODULE=on
12+
ENV CGO_ENABLED=0
13+
14+
# Build dependencies
15+
WORKDIR /go/src/
16+
COPY . .
17+
RUN apk update && apk add make git
18+
RUN make build
19+
20+
# Second stage
21+
FROM alpine:3.15
22+
23+
COPY --from=builder /go/src/build/redfish_exporter /usr/local/bin/redfish_exporter
24+
RUN mkdir /etc/prometheus
25+
COPY config.yml.example /etc/prometheus/redfish_exporter.yml
26+
CMD ["/usr/local/bin/redfish_exporter","--config.file","/etc/prometheus/redfish_exporter.yml"]

0 commit comments

Comments
 (0)