Changed to debian:stretch as a base
This commit is contained in:
parent
2e0746d1f6
commit
32c0d9efd5
@ -7,18 +7,15 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
VERSION: latest
|
VERSION: latest
|
||||||
CACHETAG: build
|
CACHETAG: build
|
||||||
DOCKER_REGISTRY: registry.leenooks.net
|
DOCKER_HOST: tcp://${CI_REGISTRY}-leenooks-ci-docker:2375
|
||||||
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind
|
- ${CI_REGISTRY}/leenooks/ci-docker:dind
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- docker info
|
- docker info
|
||||||
- docker version
|
- docker version
|
||||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${DOCKER_REGISTRY}
|
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
||||||
- 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
|
||||||
@ -33,7 +30,7 @@ test:
|
|||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- chmod 500 init
|
- [ -f init ] && chmod 500 init
|
||||||
- docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true
|
- 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 build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
|
||||||
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|
||||||
|
15
Dockerfile
15
Dockerfile
@ -1,18 +1,11 @@
|
|||||||
# NAME leenooks/smtp
|
# NAME leenooks/smtp
|
||||||
# VERSION latest
|
# VERSION latest
|
||||||
# BUILD docker build -t="leenooks/smtp" .
|
|
||||||
|
|
||||||
FROM registry.leenooks.net/leenooks/base:7.E
|
FROM debian:stretch
|
||||||
|
|
||||||
# EPEL & Leenooks packages
|
RUN apt-get update \
|
||||||
RUN yum -y install \
|
&& apt-get install sendmail sasl2-bin milter-greylist -yyq \
|
||||||
make \
|
&& rm -rf /var/lib/apt/lists/* /tmp/*
|
||||||
m4 \
|
|
||||||
sendmail \
|
|
||||||
sendmail-cf \
|
|
||||||
ln-mail-server \
|
|
||||||
milter-greylist \
|
|
||||||
&& yum clean all
|
|
||||||
|
|
||||||
RUN useradd -rc "HUB Mail Relay" -M relay -NG mail -s /sbin/nologin && echo relay:SmTpR3l@Y | chpasswd
|
RUN useradd -rc "HUB Mail Relay" -M relay -NG mail -s /sbin/nologin && echo relay:SmTpR3l@Y | chpasswd
|
||||||
|
|
||||||
|
5
init
5
init
@ -5,7 +5,8 @@ NAME="SMTP"
|
|||||||
|
|
||||||
function stop {
|
function stop {
|
||||||
echo "Stopping ${NAME}"
|
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
|
trap 'stop' SIGTERM
|
||||||
@ -17,7 +18,7 @@ fi
|
|||||||
|
|
||||||
if [ "$1" == "start" ]; then
|
if [ "$1" == "start" ]; then
|
||||||
/usr/sbin/saslauthd -m /run/saslauthd -a pam
|
/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
|
wait
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user