0f0efe58af
Update the docker image to remove the `run.sh` script and instead run the exporter directly. This keeps the docker image as simple as possible. Update README file with extra info on how to collect textfile metrics in a docker container. BREAKING CHANGE: Using the textfile collector in docker now requires setting environment variables.
24 lines
560 B
Docker
24 lines
560 B
Docker
# Using golang:latest instead of alpine because of issues with sqlite3
|
|
FROM golang:latest AS build
|
|
|
|
# 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
|
|
|
|
|
|
FROM debian:buster-slim
|
|
|
|
# Create main app folder to run from
|
|
WORKDIR /app
|
|
|
|
# Copy compiled binary to release image
|
|
COPY --from=build /build/src/exporter /app/fail2ban-prometheus-exporter
|
|
|
|
ENTRYPOINT /app/fail2ban-prometheus-exporter
|