Changed to debian:stretch as a base

This commit is contained in:
Deon George 2018-01-31 22:56:02 +11:00
parent 2e0746d1f6
commit 32c0d9efd5
3 changed files with 11 additions and 20 deletions

View File

@ -7,18 +7,15 @@ stages:
variables:
VERSION: latest
CACHETAG: build
DOCKER_REGISTRY: registry.leenooks.net
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
DOCKER_HOST: tcp://${CI_REGISTRY}-leenooks-ci-docker:2375
services:
- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind
- ${CI_REGISTRY}/leenooks/ci-docker:dind
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}"
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
test:
stage: test
@ -33,7 +30,7 @@ test:
build:
stage: build
script:
- chmod 500 init
- [ -f init ] && chmod 500 init
- docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}

View File

@ -1,18 +1,11 @@
# NAME leenooks/smtp
# VERSION latest
# BUILD docker build -t="leenooks/smtp" .
FROM registry.leenooks.net/leenooks/base:7.E
FROM debian:stretch
# EPEL & Leenooks packages
RUN yum -y install \
make \
m4 \
sendmail \
sendmail-cf \
ln-mail-server \
milter-greylist \
&& yum clean all
RUN apt-get update \
&& apt-get install sendmail sasl2-bin milter-greylist -yyq \
&& rm -rf /var/lib/apt/lists/* /tmp/*
RUN useradd -rc "HUB Mail Relay" -M relay -NG mail -s /sbin/nologin && echo relay:SmTpR3l@Y | chpasswd

5
init
View File

@ -5,7 +5,8 @@ NAME="SMTP"
function stop {
echo "Stopping ${NAME}"
kill $(cat /var/run/sendmail.pid|head -1)
kill $(cat /run/saslauthd/saslauthd.pid)
kill $(cat /run/sendmail/mta/sendmail.pid|head -1)
}
trap 'stop' SIGTERM
@ -17,7 +18,7 @@ fi
if [ "$1" == "start" ]; then
/usr/sbin/saslauthd -m /run/saslauthd -a pam
cd /etc/mail && rm -f *.db && make && m4 sendmail.mc > sendmail.cf && /usr/sbin/sendmail -q1h -bD &
cd /etc/mail && make && make && exec /usr/sbin/sendmail -q1h -bD &
wait
else