2021-02-07 14:04:24 +01:00
|
|
|
# Using golang:latest instead of alpine because of issues with sqlite3
|
2021-03-27 18:29:28 +01:00
|
|
|
FROM golang:latest AS build
|
2021-02-07 14:04:24 +01:00
|
|
|
|
2021-02-08 20:48:55 +01:00
|
|
|
# Create build folder to compile tool
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
# Copy source files to build folder and link to the /go folder
|
|
|
|
COPY . /build
|
|
|
|
RUN ln -s /go/src/ /build/src
|
|
|
|
|
|
|
|
# Compile the tool using a Make command
|
|
|
|
RUN make build/docker
|
|
|
|
|
2021-03-27 18:29:28 +01:00
|
|
|
|
|
|
|
FROM debian:buster-slim
|
|
|
|
|
2021-02-08 20:48:55 +01:00
|
|
|
# Create main app folder to run from
|
2021-02-07 14:04:24 +01:00
|
|
|
WORKDIR /app
|
|
|
|
|
2021-03-27 18:29:28 +01:00
|
|
|
# Copy compiled binary to release image
|
|
|
|
COPY --from=build /build/src/exporter /app/fail2ban-prometheus-exporter
|
2021-02-07 14:04:24 +01:00
|
|
|
|
2022-02-20 09:17:06 +01:00
|
|
|
ENTRYPOINT ["/app/fail2ban-prometheus-exporter"]
|