-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathDockerfile
29 lines (22 loc) · 803 Bytes
/
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
# First stage: build the executable.
FROM golang:1.23-alpine as builder
WORKDIR /go/src/github.com/rekzi/clamav-prometheus-exporter/
COPY . .
RUN apk add --no-cache make
RUN make build
# Final stage: the running container.
# Use a minimal image for running the application
FROM alpine:3.21 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" ]