-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: containers via multi-platform Dockerfile (#229)
- Loading branch information
1 parent
4874efb
commit 20b353b
Showing
3 changed files
with
25 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM --platform=$BUILDPLATFORM quay.io/prometheus/golang-builder AS builder | ||
|
||
# Get sql_exporter | ||
ADD . /go/src/github.com/burningalchemist/sql_exporter | ||
WORKDIR /go/src/github.com/burningalchemist/sql_exporter | ||
|
||
# Do makefile | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make | ||
|
||
# Make image and copy build sql_exporter | ||
FROM --platform=$TARGETPLATFORM quay.io/prometheus/busybox:latest | ||
LABEL maintainer="The Prometheus Authors <prometheus-developers@googlegroups.com>" | ||
COPY --from=builder /go/src/github.com/burningalchemist/sql_exporter/sql_exporter /bin/sql_exporter | ||
|
||
EXPOSE 9399 | ||
USER nobody | ||
ENTRYPOINT [ "/bin/sql_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