This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This updates the Docker build process to be more in line with current standards for Go, and includes all the updates since 0.5.0.
- Loading branch information
1 parent
a46edf9
commit e98e2a0
Showing
4 changed files
with
18 additions
and
26 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,7 +1,16 @@ | ||
FROM busybox | ||
|
||
MAINTAINER Erik Nordström <[email protected]> | ||
# Build stage | ||
FROM golang:1.12.9-alpine AS builder | ||
COPY ./pkg prometheus-adapter/pkg | ||
COPY ./cmd prometheus-adapter/cmd | ||
COPY ./go.mod prometheus-adapter/go.mod | ||
COPY ./go.sum prometheus-adapter/go.sum | ||
RUN apk update && apk add --no-cache git \ | ||
&& cd prometheus-adapter \ | ||
&& go mod download \ | ||
&& CGO_ENABLED=0 go build -a --ldflags '-w' -o /go/prometheus-postgresql-adapter ./cmd/prometheus-postgresql-adapter | ||
|
||
COPY prometheus-postgresql-adapter / | ||
|
||
ENTRYPOINT ["/prometheus-postgresql-adapter"] | ||
# Final image | ||
FROM busybox | ||
MAINTAINER Timescale https://www.timescale.com | ||
COPY --from=builder /go/prometheus-postgresql-adapter / | ||
ENTRYPOINT ["/prometheus-postgresql-adapter"] |
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