Change Image
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
This commit is contained in:
57
Stable/Dockerfile
Normal file
57
Stable/Dockerfile
Normal 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-stable/gpg.key | apt-key add - \
|
||||
&& echo "deb http://rspamd.com/apt-stable/ $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 - STABLE" \
|
||||
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 \
|
15
Stable/hooks/build
Normal file
15
Stable/hooks/build
Normal file
@ -0,0 +1,15 @@
|
||||
#!/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"
|
||||
|
||||
VERSION=$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^[[:xdigit:]]\{40\}[[:blank:]]refs\/tags\/\([0-9]\{1\}\.[0-9]\{1,2\}\($\|\.[0-9]\{1,2\}$\)\)/\1/p" | sort --version-sort | tail -1)
|
||||
|
||||
docker build \
|
||||
--build-arg VERSION=${VERSION} \
|
||||
--build-arg COMMIT=$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^\([[:xdigit:]]\{40\}\)[[:blank:]]refs\/tags\/${VERSION}^{}$/\1/p" | xargs git rev-parse --short) \
|
||||
--build-arg BRANCH=$(git rev-parse --abbrev-ref HEAD) \
|
||||
--build-arg DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||
-t ${IMAGE_NAME} .
|
9
Stable/hooks/post_push
Normal file
9
Stable/hooks/post_push
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION=$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^[[:xdigit:]]\{40\}[[:blank:]]refs\/tags\/\([0-9]\{1\}\.[0-9]\{1,2\}\($\|\.[0-9]\{1,2\}$\)\)/\1/p" | sort --version-sort | tail -1)
|
||||
|
||||
docker tag \
|
||||
"${IMAGE_NAME}" \
|
||||
"${DOCKER_REPO}:stable-${VERSION}"
|
||||
docker push \
|
||||
"${DOCKER_REPO}:stable-${VERSION}"
|
13
Stable/rspamd.conf.local.override
Normal file
13
Stable/rspamd.conf.local.override
Normal 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"
|
||||
}
|
1
Stable/worker-controller.inc
Normal file
1
Stable/worker-controller.inc
Normal file
@ -0,0 +1 @@
|
||||
bind_socket = "*:11334";
|
1
Stable/worker-proxy.inc
Normal file
1
Stable/worker-proxy.inc
Normal file
@ -0,0 +1 @@
|
||||
bind_socket = *:11332;
|
Reference in New Issue
Block a user