-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
69 lines (64 loc) · 2.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
FROM alpine:3.2
MAINTAINER Jacob Blain Christen <mailto:dweomer5@gmail.com, https://github.com/dweomer, https://twitter.com/dweomer>
ENV CYRUS_SASL_VERSION=2.1.26 \
TINI_VERSION=0.8.3
RUN set -x \
&& mkdir -p /srv/saslauthd.d /tmp/cyrus-sasl /var/run/saslauthd \
&& export BUILD_DEPS=" \
autoconf \
automake \
curl \
db-dev \
g++ \
gcc \
gzip \
heimdal-dev \
libtool \
make \
openldap-dev \
openssl-dev \
tar \
" \
&& apk add --update ${BUILD_DEPS} \
cyrus-sasl \
libldap \
# Install tini
&& curl -fSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static -o /bin/tini \
&& chmod +x /bin/tini \
# Install cyrus-sasl from source
&& curl -fL ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-${CYRUS_SASL_VERSION}.tar.gz -o /tmp/cyrus-sasl.tgz \
&& curl -fL http://git.alpinelinux.org/cgit/aports/plain/main/cyrus-sasl/cyrus-sasl-2.1.25-avoid_pic_overwrite.patch?h=3.2-stable -o /tmp/cyrus-sasl-2.1.25-avoid_pic_overwrite.patch \
&& curl -fL http://git.alpinelinux.org/cgit/aports/plain/main/cyrus-sasl/cyrus-sasl-2.1.26-size_t.patch?h=3.2-stable -o /tmp/cyrus-sasl-2.1.26-size_t.patch \
&& tar -xzf /tmp/cyrus-sasl.tgz --strip=1 -C /tmp/cyrus-sasl \
&& cd /tmp/cyrus-sasl \
&& patch -p1 -i /tmp/cyrus-sasl-2.1.25-avoid_pic_overwrite.patch || true \
&& patch -p1 -i /tmp/cyrus-sasl-2.1.26-size_t.patch || true \
&& ./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-anon \
--enable-cram \
--enable-digest \
--enable-ldapdb \
--enable-login \
--enable-ntlm \
--disable-otp \
--enable-plain \
--with-gss_impl=heimdal \
--with-devrandom=/dev/urandom \
--with-ldap=/usr \
--with-saslauthd=/var/run/saslauthd \
--mandir=/usr/share/man \
&& make -j1 \
&& make -j1 install \
# Clean up build-time packages
&& apk del --purge ${BUILD_DEPS} \
# Clean up anything else
&& rm -fr \
/tmp/* \
/var/tmp/* \
/var/cache/apk/*
VOLUME ["/var/run/saslauthd"]
ENTRYPOINT ["/bin/tini", "--", "/usr/sbin/saslauthd"]
CMD ["-a", "ldap", "-d", "1"]