forked from kwanhur/ipvs-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.
Merge pull request #1 from BedrockStreaming/feat/build-from-docker
feat(build): Build binary from docker
- Loading branch information
Showing
2 changed files
with
11 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,5 +1,2 @@ | ||
.* | ||
vendor | ||
Dockerfile | ||
Makefile | ||
README.md |
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,11 +1,20 @@ | ||
# Multistage build | ||
# #1 stage to build the Go binary | ||
FROM golang AS builder | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
RUN make build | ||
|
||
# #2 stage copies binary from #1 + entrypoint | ||
FROM quay.io/prometheus/busybox:latest | ||
MAINTAINER kwanhur <[email protected]> | ||
|
||
COPY ipvs-exporter /usr/bin/ipvs-exporter | ||
COPY --from=builder /usr/src/app/ipvs-exporter /usr/bin/ipvs-exporter | ||
COPY docker-entrypoint.sh /bin/docker-entrypoint.sh | ||
RUN chmod 755 /bin/docker-entrypoint.sh | ||
|
||
ENV METRICS_ENDPOINT "/metrics" | ||
ENV METRICS_ADDR ":9911" | ||
ENV DEFAULT_METRICS_NS "ipvs" | ||
|
||
ENTRYPOINT [ "docker-entrypoint.sh" ] | ||
ENTRYPOINT [ "docker-entrypoint.sh" ] |