2021-02-07 13:04:24 +00:00
|
|
|
# Using golang:latest instead of alpine because of issues with sqlite3
|
2021-03-27 17:29:28 +00:00
|
|
|
FROM golang:latest AS build
|
2021-02-07 13:04:24 +00:00
|
|
|
|
2021-02-08 19:48:55 +00: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 17:29:28 +00:00
|
|
|
|
|
|
|
FROM debian:buster-slim
|
|
|
|
|
2021-02-08 19:48:55 +00:00
|
|
|
# Create main app folder to run from
|
2021-02-07 13:04:24 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
2021-03-27 17:29:28 +00:00
|
|
|
# Copy compiled binary to release image
|
|
|
|
COPY --from=build /build/src/exporter /app/fail2ban-prometheus-exporter
|
2021-02-07 13:04:24 +00:00
|
|
|
|
2022-02-19 14:10:36 +00:00
|
|
|
ENTRYPOINT /app/fail2ban-prometheus-exporter
|