Changed to debian:stretch as a base
This commit is contained in:
parent
f4a341125f
commit
6edc31cda0
@ -17,8 +17,6 @@ before_script:
|
||||
- docker info
|
||||
- docker version
|
||||
- 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:
|
||||
stage: test
|
||||
|
11
Dockerfile
11
Dockerfile
@ -1,9 +1,16 @@
|
||||
# NAME leenooks/rspamd
|
||||
# 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
|
||||
|
||||
|
8
init
8
init
@ -2,18 +2,20 @@
|
||||
set -e
|
||||
|
||||
NAME="RSPAMD"
|
||||
CLAMAV="clamav"
|
||||
WAIT=15
|
||||
TRIES=5
|
||||
|
||||
function stop {
|
||||
echo "Stopping ${NAME}"
|
||||
kill $(cat /var/run/rspamd.pid)
|
||||
kill $(cat /var/run/rmilter.pid)
|
||||
}
|
||||
|
||||
trap 'stop' SIGTERM
|
||||
|
||||
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 /usr/sbin/rmilter ] && /usr/sbin/rmilter -n -c /etc/rmilter/rmilter.conf &
|
||||
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/bin/rspamd ] && exec /usr/bin/rspamd -u _rspamd -g _rspamd -c /etc/rspamd/rspamd.conf -f -p /var/run/rspamd.pid &
|
||||
|
||||
wait
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user