-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 833 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 833 Bytes
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
# First stage: build the executable.
FROM golang:1.25-alpine as builder
WORKDIR /go/src/github.com/rekzi/clamav-prometheus-exporter/
COPY . .
ARG VERSION
RUN apk add --no-cache make
RUN make build VERSION=$VERSION
# Final stage: the running container.
# Use a minimal image for running the application
FROM alpine:3.22 AS final
# Install necessary certificates
RUN apk add --no-cache ca-certificates
# Set the working directory for the runtime
WORKDIR /bin/
# Import the compiled executable from the first stage.
COPY --from=builder /go/src/github.com/rekzi/clamav-prometheus-exporter/clamav-prometheus-exporter .
RUN addgroup prometheus
RUN adduser -S -u 1000 prometheus \
&& chown -R prometheus:prometheus /bin
USER 1000
# Default port for metrics exporters
EXPOSE 9810
ENTRYPOINT [ "/bin/clamav-prometheus-exporter" ]