ipabusedb-docker-reporter: rename from ipabusedb-docker-ssh, add Dockerfile with runit service
Build on git.eeqj.de/sneak/baseimage:2026-11-05 with the docker CLI copied from docker:cli. A runit service sleeps INTERVAL seconds (default 1200), then runs the reporter with --since INTERVAL --submit; DOCKER_CONTAINER_NAME and IPABUSEDB_API_KEY come from the container environment. Add .dockerignore, make image, and README section; fix the binary name in .gitignore.
This commit is contained in:
1 parent
b8c36689ae
commit
1aa7d84401
16 files changed
+135
-11
No files matched your search
@@ -0,0 +1,39 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
#
|
||||
# Runs ipabusedb-docker-reporter as a runit service under the baseimage's
|
||||
# runsvinit: sleep INTERVAL seconds, report the last INTERVAL seconds of
|
||||
# sshd brute-force attempts to AbuseIPDB, repeat.
|
||||
#
|
||||
# Run with the host's docker socket bind-mounted and the config in the
|
||||
# container environment:
|
||||
#
|
||||
# docker run -d --restart unless-stopped \
|
||||
# -v /var/run/docker.sock:/var/run/docker.sock \
|
||||
# -e DOCKER_CONTAINER_NAME=sshd \
|
||||
# -e IPABUSEDB_API_KEY=... \
|
||||
# -e INTERVAL=1200 \
|
||||
# ipabusedb-docker-reporter
|
||||
|
||||
FROM git.eeqj.de/sneak/baseimage:2026-11-05
|
||||
|
||||
# The reporter shells out to "docker logs", so it needs the docker CLI.
|
||||
# The static binary from the official CLI image avoids pulling the whole
|
||||
# docker.io package (and daemon) in via apt.
|
||||
COPY --from=docker:cli /usr/local/bin/docker /usr/local/bin/docker
|
||||
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN --mount=type=cache,target=/root/go/pkg/mod go mod download
|
||||
COPY *.go ./
|
||||
RUN --mount=type=cache,target=/root/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
CGO_ENABLED=0 go build -o /usr/local/bin/ipabusedb-docker-reporter .
|
||||
|
||||
COPY sv/ipabusedb-docker-reporter/run /etc/sv/ipabusedb-docker-reporter/run
|
||||
RUN chmod +x /etc/sv/ipabusedb-docker-reporter/run \
|
||||
&& ln -s /etc/sv/ipabusedb-docker-reporter /etc/service/ipabusedb-docker-reporter
|
||||
|
||||
# Seconds to sleep between runs; also the --since window of each run.
|
||||
ENV INTERVAL=1200
|
||||
|
||||
WORKDIR /
|
||||
Reference in new issue
Block a user