-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (24 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
34 lines (24 loc) · 1.3 KB
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
FROM alpine@sha256:5b10f432ef3da1b8d4c7eb6c487f2f5a8f096bc91145e68878dd4a5019afde11 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
WORKDIR /imapfilter_build
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 . \
&& git checkout "${imapfilter_spec}" \
&& make && make install
FROM alpine@sha256:5b10f432ef3da1b8d4c7eb6c487f2f5a8f096bc91145e68878dd4a5019afde11
# create an empty config.lua to prevent an error when running imapfilter directly
RUN adduser -D -u 1001 imapfilter \
&& mkdir -p /home/imapfilter/.imapfilter && touch /home/imapfilter/.imapfilter/config.lua \
&& mkdir -p /opt/imapfilter/config \
&& chown imapfilter: /opt/imapfilter
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
RUN apk --no-cache add lua lua-dev openssl pcre git
COPY --chown=imapfilter: --chmod=a+x entrypoint.sh /entrypoint.sh
USER imapfilter
ENTRYPOINT ["/entrypoint.sh"]