-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (24 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23 AS builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app/
ADD . .
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o ipset-exporter cmd/ipset-exporter/main.go
FROM --platform=${TARGETPLATFORM:-linux/amd64} scratch
ARG DATE_CREATED
ARG APP_VERSION
ENV APP_VERSION=$APP_VERSION
LABEL org.opencontainers.image.created=$DATE_CREATED
LABEL org.opencontainers.version="$APP_VERSION"
LABEL org.opencontainers.image.authors="Arash Hatami <[email protected]>"
LABEL org.opencontainers.image.vendor="hatamiarash7"
LABEL org.opencontainers.image.title="ipset-exporter"
LABEL org.opencontainers.image.description="It's a simple Prometheus exporter for ipset"
LABEL org.opencontainers.image.source="https://github.com/hatamiarash7/ipset-exporter"
LABEL org.opencontainers.image.url="https://github.com/hatamiarash7/ipset-exporter"
LABEL org.opencontainers.image.documentation="https://github.com/hatamiarash7/ipset-exporter"
WORKDIR /app/
COPY --from=builder /app/ipset-exporter /app/ipset-exporter
ENTRYPOINT ["/app/ipset-exporter"]