forked from prometheus/mysqld_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.
Build the Docker image for Intel and ARM
- Loading branch information
Showing
2 changed files
with
13 additions
and
12 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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest | ||
LABEL maintainer="The Prometheus Authors <[email protected]>" | ||
FROM --platform=$BUILDPLATFORM golang:bookworm AS build | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
RUN apt-get -y install make | ||
COPY . /mysqld_exporter | ||
RUN rm -f /mysqld_exporter/mysqld_exporter | ||
RUN CGO_ENABLED=0 GOOS="$TARGETOS" GOARCH="$TARGETARCH" make -C /mysqld_exporter build | ||
|
||
COPY ./mysqld_exporter /bin/mysqld_exporter | ||
|
||
EXPOSE 9104 | ||
USER nobody | ||
ENTRYPOINT [ "/bin/mysqld_exporter" ] | ||
FROM golang:alpine | ||
COPY --from=build /mysqld_exporter/mysqld_exporter /bin/mysqld_exporter | ||
EXPOSE 9104 | ||
USER nobody | ||
ENTRYPOINT ["/bin/mysqld_exporter"] |