forked from zhangjianweibj/prometheus-libvirt-exporter
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from NicoWK/master
Add docker image to the exporter
- Loading branch information
Showing
4 changed files
with
40 additions
and
3 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
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,17 @@ | ||
FROM golang:1.21 as builder | ||
WORKDIR /app | ||
|
||
# Requirements/Dependencies | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
# Build | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o prometheus-libvirt-exporter | ||
|
||
FROM scratch | ||
COPY --from=builder app/prometheus-libvirt-exporter usr/bin/prometheus-libvirt-exporter | ||
# Default listen on port 9177 | ||
EXPOSE 9177 | ||
# Start | ||
CMD ["usr/bin/prometheus-libvirt-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM scratch | ||
COPY prometheus-libvirt-exporter /prometheus-libvirt-exporter | ||
ENTRYPOINT ["/prometheus-libvirt-exporter"] |