Change Image

Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
This commit is contained in:
Patrick Niebeling
2022-02-28 23:10:40 +01:00
parent 6ffbdcd7d4
commit 3ca96a7270
21 changed files with 257 additions and 669 deletions

57
Experimental/Dockerfile Normal file
View File

@ -0,0 +1,57 @@
FROM debian:stable-slim
LABEL maintainer="gnilebein - <docker@gnilebein.nl>"
# Set apt non-interactive
ENV DEBIAN_FRONTEND noninteractive
# Install Rspamd
RUN set -x \
&& apt update \
&& apt --no-install-recommends install -y lsb-release wget gnupg openssl ca-certificates \
&& DEBIAN_CODE_NAME=`lsb_release -c -s` \
&& wget -O - https://rspamd.com/apt/gpg.key | apt-key add - \
&& echo "deb http://rspamd.com/apt/ $DEBIAN_CODE_NAME main" > /etc/apt/sources.list.d/rspamd.list \
&& apt purge -y lsb-release wget gnupg \
&& apt update \
&& apt --no-install-recommends install -y rspamd \
&& apt autoremove --purge -y \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
# Override default settings
COPY rspamd.conf.local.override /etc/rspamd/
COPY worker-controller.inc /etc/rspamd/override.d/
COPY worker-proxy.inc /etc/rspamd/override.d/
# Keep database and configuration persistent
VOLUME /etc/rspamd/local.d
VOLUME /var/lib/rspamd
# Port 11334 is for web frontend
# Port 11332 is for milter
# Port 11333 is for worker
EXPOSE 11332 11334
# Healtcheck if Rspamd is returning stats
HEALTHCHECK --interval=1m --timeout=5s --start-period=10s \
CMD /usr/bin/rspamadm control stat || exit 1
# Run Rspamd
ENTRYPOINT ["/usr/bin/rspamd","-f","-u","_rspamd","-g","_rspamd"]
# Setup Labels
ARG VERSION
ARG COMMIT
ARG BRANCH
ARG DATE
LABEL org.label-schema.name="Rspamd" \
org.label-schema.description="Rspamd Spam Filter - EXPERIMENTAL" \
org.label-schema.usage="https://hub.docker.com/r/gnilebein/rspamd/" \
org.label-schema.url="https://rspamd.com" \
org.label-schema.vendor="gnilebein" \
org.label-schema.schema-version="1.0" \
org.label-schema.version=$VERSION \
org.label-schema.vcs-url="https://github.com/rspamd/rspamd/" \
org.label-schema.vcs-ref=$COMMIT \
org.label-schema.build-date=$DATE \

13
Experimental/hooks/build Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# hooks/build
# https://docs.docker.com/docker-cloud/builds/advanced/
# $IMAGE_NAME var is injected into the build so the tag is correct.
echo "[***] Build hook running"
docker build \
--build-arg VERSION=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_\(.*\)\~git.*\~.*.dsc\".*/\1/p" | tail -1) \
--build-arg COMMIT=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_.*\~git.*\~\(.*\)\~.*.dsc\".*/\1/p" | tail -1) \
--build-arg BRANCH=$(git rev-parse --abbrev-ref HEAD) \
--build-arg DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t $IMAGE_NAME .

View File

@ -0,0 +1,11 @@
#!/bin/bash
#VERSION=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_\([0-9]\{1\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}\)-[0-9]\{1,2\}~git.*\~.*.dsc\".*/\1/p" | tail -1)
#MVERSION=${VERSION%.*}
MVERSION=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_\(.*\)\~git.*\~.*.dsc\".*/\1/p" | tail -1)
docker tag \
"${IMAGE_NAME}" \
"${DOCKER_REPO}:experimental-${MVERSION}"
docker push \
"${DOCKER_REPO}:experimental-${MVERSION}"

View File

@ -0,0 +1,13 @@
options {
pidfile = false;
.include "$CONFDIR/options.inc"
.include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/options.inc"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/options.inc"
}
logging {
type = "console";
.include "$CONFDIR/logging.inc"
.include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/logging.inc"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/logging.inc"
}

View File

@ -0,0 +1 @@
bind_socket = "*:11334";

View File

@ -0,0 +1 @@
bind_socket = *:11332;