|
2 | 2 | set -e
|
3 | 3 |
|
4 | 4 | if [ -f /etc/os-release ]; then
|
5 |
| - . /etc/os-release |
| 5 | + . /etc/os-release |
6 | 6 | fi
|
7 | 7 |
|
8 | 8 | # Installs postfix, opendkim, and other required packages using the
|
9 | 9 | # Alpine package manager. This function is called when the image is
|
10 | 10 | # built on an Alpine base image.
|
11 | 11 | do_alpine() {
|
12 |
| - architecture_specific_packages="" |
13 |
| - apk update |
| 12 | + architecture_specific_packages="" |
| 13 | + apk update |
14 | 14 |
|
15 |
| - if [ "$(apk info postfix-pgsql | grep -R '^postfix-pgsql')" != "" ]; then |
16 |
| - architecture_specific_packages="${architecture_specific_packages} postfix-pgsql" |
17 |
| - fi |
18 |
| - if [ "$(apk info postfix-mysql | grep -R '^postfix-mysql')" != "" ]; then |
19 |
| - architecture_specific_packages="${architecture_specific_packages} postfix-mysql" |
20 |
| - fi |
| 15 | + if [ "$(apk info postfix-pgsql | grep -R '^postfix-pgsql')" != "" ]; then |
| 16 | + architecture_specific_packages="${architecture_specific_packages} postfix-pgsql" |
| 17 | + fi |
| 18 | + if [ "$(apk info postfix-mysql | grep -R '^postfix-mysql')" != "" ]; then |
| 19 | + architecture_specific_packages="${architecture_specific_packages} postfix-mysql" |
| 20 | + fi |
21 | 21 |
|
22 |
| - apk add --upgrade cyrus-sasl cyrus-sasl-static cyrus-sasl-digestmd5 cyrus-sasl-crammd5 cyrus-sasl-login cyrus-sasl-ntlm libsasl |
23 |
| - apk add postfix postfix-pcre postfix-ldap ${architecture_specific_packages} |
24 |
| - apk add opendkim |
25 |
| - apk add --upgrade \ |
26 |
| - bash \ |
27 |
| - bind-tools \ |
28 |
| - ca-certificates \ |
29 |
| - jsoncpp \ |
30 |
| - libcurl \ |
31 |
| - lmdb \ |
32 |
| - logrotate \ |
33 |
| - musl \ |
34 |
| - musl-utils \ |
35 |
| - netcat-openbsd \ |
36 |
| - opendkim-utils \ |
37 |
| - rsyslog \ |
38 |
| - supervisor \ |
39 |
| - tzdata |
| 22 | + apk add --upgrade cyrus-sasl cyrus-sasl-static cyrus-sasl-digestmd5 cyrus-sasl-crammd5 cyrus-sasl-login cyrus-sasl-ntlm libsasl |
| 23 | + apk add postfix postfix-pcre postfix-ldap ${architecture_specific_packages} |
| 24 | + apk add opendkim |
| 25 | + apk add --upgrade \ |
| 26 | + bash \ |
| 27 | + bind-tools \ |
| 28 | + ca-certificates \ |
| 29 | + jsoncpp \ |
| 30 | + libcurl \ |
| 31 | + lmdb \ |
| 32 | + logrotate \ |
| 33 | + musl \ |
| 34 | + musl-utils \ |
| 35 | + netcat-openbsd \ |
| 36 | + opendkim-utils \ |
| 37 | + rsyslog \ |
| 38 | + supervisor \ |
| 39 | + tzdata |
40 | 40 | }
|
41 | 41 |
|
42 | 42 |
|
43 | 43 | # Installs postfix, opendkim, and other required packages using the
|
44 | 44 | # ubuntu/debian package manager. This function is called when the
|
45 | 45 | # image is built on a ubuntu/debian base image.
|
46 | 46 | do_ubuntu() {
|
47 |
| - architecture_specific_packages="" |
48 |
| - RELEASE_SPECIFIC_PACKAGES="" |
49 |
| - export DEBCONF_NOWARNINGS=yes |
50 |
| - export DEBIAN_FRONTEND=noninteractive |
51 |
| - echo "Europe/Berlin" > /etc/timezone |
52 |
| - apt-get update -y -q |
53 |
| - |
54 |
| - if [ "$(apt-cache search --names-only '^postfix-pgsql$')" != "" ]; then |
55 |
| - architecture_specific_packages="${architecture_specific_packages} postfix-pgsql" |
56 |
| - fi |
57 |
| - if [ "$(apt-cache search --names-only '^postfix-mysql$')" != "" ]; then |
58 |
| - architecture_specific_packages="${architecture_specific_packages} postfix-mysql" |
59 |
| - fi |
| 47 | + architecture_specific_packages="" |
| 48 | + RELEASE_SPECIFIC_PACKAGES="" |
| 49 | + export DEBCONF_NOWARNINGS=yes |
| 50 | + export DEBIAN_FRONTEND=noninteractive |
| 51 | + echo "Europe/Berlin" > /etc/timezone |
| 52 | + apt-get update -y -q |
60 | 53 |
|
61 |
| - apt-get install -y libsasl2-modules sasl2-bin |
62 |
| - apt-get install -y postfix postfix-pcre postfix-ldap ${architecture_specific_packages} |
63 |
| - apt-get install -y opendkim |
64 |
| - local libcurl="libcurl4" |
65 |
| - if [ "$(apt-cache search --names-only '^libcurl4t64$')" != "" ]; then |
66 |
| - libcurl="libcurl4t64" |
67 |
| - fi |
68 |
| - apt-get install -y \ |
69 |
| - ${libcurl} ${RELEASE_SPECIFIC_PACKAGES} \ |
70 |
| - bash \ |
71 |
| - ca-certificates \ |
72 |
| - colorized-logs \ |
73 |
| - cron \ |
74 |
| - curl \ |
75 |
| - dnsutils \ |
76 |
| - libjsoncpp25 \ |
77 |
| - logrotate \ |
78 |
| - net-tools \ |
79 |
| - netcat-openbsd \ |
80 |
| - opendkim-tools \ |
81 |
| - postfix-lmdb \ |
82 |
| - procps \ |
83 |
| - rsyslog \ |
84 |
| - sasl2-bin \ |
85 |
| - supervisor \ |
86 |
| - tzdata \ |
87 |
| - apt-get clean |
88 |
| - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 54 | + if [ "$(apt-cache search --names-only '^postfix-pgsql$')" != "" ]; then |
| 55 | + architecture_specific_packages="${architecture_specific_packages} postfix-pgsql" |
| 56 | + fi |
| 57 | + if [ "$(apt-cache search --names-only '^postfix-mysql$')" != "" ]; then |
| 58 | + architecture_specific_packages="${architecture_specific_packages} postfix-mysql" |
| 59 | + fi |
| 60 | + |
| 61 | + apt-get install -y libsasl2-modules sasl2-bin |
| 62 | + apt-get install -y postfix postfix-pcre postfix-ldap ${architecture_specific_packages} |
| 63 | + apt-get install -y opendkim |
| 64 | + local libcurl="libcurl4" |
| 65 | + if [ "$(apt-cache search --names-only '^libcurl4t64$')" != "" ]; then |
| 66 | + libcurl="libcurl4t64" |
| 67 | + fi |
| 68 | + apt-get install -y \ |
| 69 | + ${libcurl} ${RELEASE_SPECIFIC_PACKAGES} \ |
| 70 | + bash \ |
| 71 | + ca-certificates \ |
| 72 | + colorized-logs \ |
| 73 | + cron \ |
| 74 | + curl \ |
| 75 | + dnsutils \ |
| 76 | + libjsoncpp25 \ |
| 77 | + logrotate \ |
| 78 | + net-tools \ |
| 79 | + netcat-openbsd \ |
| 80 | + opendkim-tools \ |
| 81 | + postfix-lmdb \ |
| 82 | + procps \ |
| 83 | + rsyslog \ |
| 84 | + sasl2-bin \ |
| 85 | + supervisor \ |
| 86 | + tzdata |
| 87 | + apt-get clean |
| 88 | + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
89 | 89 | }
|
90 | 90 |
|
91 | 91 | if [ -f /etc/alpine-release ]; then
|
92 |
| - do_alpine |
| 92 | + do_alpine |
93 | 93 | else
|
94 |
| - do_ubuntu |
| 94 | + do_ubuntu |
95 | 95 | fi
|
96 | 96 |
|
97 | 97 | # Some services (eg. cron) will complain if this file does not exists, even if it's empty.
|
|
0 commit comments