Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Base to Alpine 3.8 #43

Merged
merged 2 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
FROM sillelien/base-alpine:0.10
FROM alpine:3.8
LABEL maintainer="Zhuohuan LI <zixia@zixia.net>"

ENV BATS_VERSION 0.4.0
ENV BATS_VERSION 1.1.0
ENV S6_VERSION 1.21.7.0

## Install System

RUN apk add --update --no-cache \
bash \
curl \
cyrus-sasl \
drill \
logrotate \
openssl \
postfix \
cyrus-sasl \
syslog-ng \
\
&& curl -s -o "/tmp/v${BATS_VERSION}.tar.gz" -L \
"https://github.com/sstephenson/bats/archive/v${BATS_VERSION}.tar.gz" \
"https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz" \
&& tar -xzf "/tmp/v${BATS_VERSION}.tar.gz" -C /tmp/ \
&& bash "/tmp/bats-${BATS_VERSION}/install.sh" /usr/local \
&& bash "/tmp/bats-core-${BATS_VERSION}/install.sh" /usr/local \
\
&& rm -rf /tmp/*

## Install s6 process manager
RUN curl -L -s https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-amd64.tar.gz \
| tar xzf - -C /

## Configure Service

COPY install/main.dist.cf /etc/postfix/main.cf
COPY install/master.dist.cf /etc/postfix/master.cf
COPY install/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf

RUN cat /dev/null > /etc/postfix/aliases && newaliases \
&& echo simple-mail-forwarder.com > /etc/hostname \
Expand All @@ -43,6 +50,9 @@ RUN bash -n /app/init-openssl.sh && chmod +x /app/init-openssl.sh
COPY install/postfix.sh /etc/services.d/postfix/run
RUN bash -n /etc/services.d/postfix/run && chmod +x /etc/services.d/postfix/run

COPY install/syslog-ng.sh /etc/services.d/syslog-ng/run
RUN bash -n /etc/services.d/syslog-ng/run && chmod +x /etc/services.d/syslog-ng/run

COPY entrypoint.sh /entrypoint.sh
RUN bash -n /entrypoint.sh && chmod a+x /entrypoint.sh

Expand Down
2 changes: 0 additions & 2 deletions install/postfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ daemon_directory=`$command_directory/postconf -h daemon_directory`
$daemon_directory/master -t || $command_directory/postfix stop

# make consistency check
chown root /var/spool/postfix
chown root /var/spool/postfix/pid
$command_directory/postfix check >/dev/console 2>&1

# run Postfix
Expand Down
43 changes: 43 additions & 0 deletions install/syslog-ng.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@version: 3.9

# Options
options {
# Disable statistic log messages.
stats_freq(0);
};

# Sources
source s_dgram {
unix-dgram("/dev/log");
internal();
};

# Filters
filter f_out {
level(info..warn);
};
filter f_err {
level(err..emerg,debug);
};

# Destinations
destination d_stdout {
pipe("/dev/stdout");
};

destination d_stderr {
pipe("/dev/stderr");
};

# Logs
log {
source(s_dgram);
filter(f_out);
destination(d_stdout);
};

log {
source(s_dgram);
filter(f_err);
destination(d_stderr);
};
3 changes: 3 additions & 0 deletions install/syslog-ng.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/execlineb -P

/usr/sbin/syslog-ng --cfgfile=/etc/syslog-ng/syslog-ng.conf -F