-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
40 lines (26 loc) · 1.09 KB
/
Containerfile
File metadata and controls
40 lines (26 loc) · 1.09 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
35
36
37
38
39
40
FROM alpine as builder
RUN apk update && apk add --no-cache git openssl openssl-dev make lua5.1 lua-dev pcre2 pcre2-dev alpine-sdk
WORKDIR /src
RUN git clone https://github.com/lefcha/imapfilter.git
RUN cd imapfilter; make all
FROM alpine
#
# Ensure we have imapfilter dependencies
RUN apk update && apk add --no-cache tini bash ca-certificates openssl lua5.1 pcre2
RUN mkdir -p /usr/local/share/imapfilter
COPY --from=builder /src/imapfilter/src/imapfilter /usr/local/bin/
COPY --from=builder /src/imapfilter/src/*.lua /usr/local/share/imapfilter/
# ensure every user can run imapfilter
RUN chmod a+x /usr/local/bin/imapfilter
ADD scripts/entryPoint.sh /entryPoint.sh
RUN chmod +x /entryPoint.sh
# add a user for running imapfilter in the container
RUN addgroup imapfilter
RUN adduser -D -G imapfilter imapfilter
# ensure a homedirectory for the user exists and has correct access rights
RUN mkdir -p /home/imapfilter
RUN chown imapfilter /home/imapfilter
RUN chgrp imapfilter /home/imapfilter
# run everything as the imapfilter user
USER imapfilter
ENTRYPOINT ["/sbin/tini", "--", "/entryPoint.sh"]