Changed to debian:stretch as a base

This commit is contained in:
Deon George 2018-01-31 10:14:07 +11:00
parent f4a341125f
commit 6edc31cda0
3 changed files with 14 additions and 7 deletions

View File

@ -17,8 +17,6 @@ before_script:
- docker info - docker info
- docker version - docker version
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${DOCKER_REGISTRY} - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${DOCKER_REGISTRY}
- echo "CI_PROJECT_PATH ${CI_PROJECT_PATH} CI_COMMIT_TAG ${CI_COMMIT_TAG} CI_COMMIT_REF_NAME ${CI_COMMIT_REF_NAME}"
- echo "CI_REGISTRY ${CI_REGISTRY} CI_REGISTRY_IMAGE ${CI_REGISTRY_IMAGE} CI ${CI}"
test: test:
stage: test stage: test

View File

@ -1,9 +1,16 @@
# NAME leenooks/rspamd # NAME leenooks/rspamd
# VERSION latest # VERSION latest
FROM registry.leenooks.net/leenooks/base:7.E FROM debian:stretch
RUN curl -o /etc/yum.repos.d/rspamd.repo http://rspamd.com/rpm-stable/centos-7/rspamd.repo && rpm --import http://rspamd.com/rpm-stable/gpg.key && yum -y install rspamd && yum clean all RUN apt-get update \
&& apt-get install curl gnupg2 procps -yyq \
&& curl -L https://rspamd.com/apt-stable/gpg.key | apt-key add - \
&& apt-get purge curl gnupg2 -yyq && apt autoremove -yyq \
&& echo "deb http://rspamd.com/apt-stable/ stretch main" > /etc/apt/sources.list.d/rspamd.list \
&& apt-get update \
&& apt-get install rspamd -yyq \
&& rm -rf /var/lib/apt/lists/* /tmp/*
EXPOSE 11332 11333 11334 EXPOSE 11332 11333 11334

8
init
View File

@ -2,18 +2,20 @@
set -e set -e
NAME="RSPAMD" NAME="RSPAMD"
CLAMAV="clamav"
WAIT=15
TRIES=5
function stop { function stop {
echo "Stopping ${NAME}" echo "Stopping ${NAME}"
kill $(cat /var/run/rspamd.pid) kill $(cat /var/run/rspamd.pid)
kill $(cat /var/run/rmilter.pid)
} }
trap 'stop' SIGTERM trap 'stop' SIGTERM
if [ "$1" == "start" ]; then if [ "$1" == "start" ]; then
[ -x /usr/bin/rspamd ] && /usr/bin/rspamd -u _rspamd -g _rspamd -c /etc/rspamd/rspamd.conf -f -p /var/run/rspamd.pid & x=0; until ping -c1 ${CLAMAV} &>/dev/null; do echo "Waiting for [${CLAMAV}]..."; let x=$x+1; if [ $x -ge ${TRIES} ]; then NOTON=1; break; fi ; sleep ${WAIT}; done ; [ -n "${NOTON}" ] && echo "No [${CLAMAV}]?" && exit 1
[ -x /usr/sbin/rmilter ] && /usr/sbin/rmilter -n -c /etc/rmilter/rmilter.conf & [ -x /usr/bin/rspamd ] && exec /usr/bin/rspamd -u _rspamd -g _rspamd -c /etc/rspamd/rspamd.conf -f -p /var/run/rspamd.pid &
wait wait
else else