-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
32 lines (24 loc) · 1.16 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
FROM alpine as builder
# imapfilter_spec can be a specific commit or a version tag
ARG imapfilter_spec=master
# Original from simbelmas:
# https://github.com/simbelmas/dockerfiles/tree/master/imapfilter
RUN apk --no-cache add lua openssl pcre git \
&& apk --no-cache add -t dev_tools lua-dev openssl-dev make gcc libc-dev pcre-dev pcre2-dev \
&& git clone https://github.com/lefcha/imapfilter.git /imapfilter_build \
&& cd /imapfilter_build \
&& git checkout "${imapfilter_spec}" \
&& make && make install
FROM alpine
COPY --from=builder /usr/local/bin/imapfilter /usr/local/bin/imapfilter
COPY --from=builder /usr/local/share/imapfilter /usr/local/share/imapfilter
COPY --from=builder /usr/local/man /usr/local/man
COPY entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh && apk --no-cache add lua lua-dev openssl pcre git \
&& adduser -D -u 1001 imapfilter \
&& mkdir /opt/imapfilter \
&& chown imapfilter: /opt/imapfilter
USER imapfilter
# create an empty config.lua to prevent an error when running imapfilter directly
RUN mkdir -p /home/imapfilter/.imapfilter && touch /home/imapfilter/.imapfilter/config.lua
ENTRYPOINT /entrypoint.sh