first commit

This commit is contained in:
Andy 2018-12-17 16:59:30 +01:00
commit 1df811cc62
Signed by: arno
GPG Key ID: 9076D5E6B31AE99C
6 changed files with 48 additions and 0 deletions

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM alpine:3.8
MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>
RUN apk update && \
apk upgrade && \
apk add dovecot runit socklog && \
rm -rf /etc/service
COPY service /etc/service/
# RUN find /etc/service -xdev -type f -name "run" -exec chmod +x '{}' \;
ENTRYPOINT runsvdir -P /etc/service

4
service/dovecot/finish Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
echo "${PWD##*/}: Exitted with $1 (signal: $2)"
[ $1 -ne 0 ] && ( echo "${PWD##*/}: rc != 0, sleeping for 5 seconds ..."; sleep 5 )

8
service/dovecot/run Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
exec 2>&1
echo "${PWD##*/}: started."
set -x
chown -Rh dovecot:dovecot -- /etc/dovecot
exec /usr/sbin/dovecot -F

4
service/logger/finish Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
echo "${PWD##*/}: Exitted with $1 (signal: $2)"
[ $1 -ne 0 ] && ( echo "${PWD##*/}: rc != 0, sleeping for 5 seconds ..."; sleep 5 )

10
service/logger/run Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Collect all logs which come to /dev/log
exec 2>&1
echo "${PWD##*/}: started."
set -x
exec chpst -Unobody socklog unix /dev/log
# exec socklog unix /dev/log
# exec socat UNIX-LISTEN:/dev/log,reuseaddr,fork -

11
start.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
IMAGE=dovecot
docker build -t $IMAGE .
docker rm -f $IMAGE
docker run -d \
-h $(hostname -f) \
--name $IMAGE \
-v /etc/localtime:/etc/localtime:ro \
$IMAGE