-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 754 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 754 Bytes
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
FROM alpine:3.12 as builder
MAINTAINER github@erebe.eu
RUN apk --no-cache add \
ca-certificates git ghc upx curl musl-dev gmp-dev zlib-dev pcre-dev
RUN curl -sSL https://get.haskellstack.org/ | sh
COPY stack.yaml /mnt
COPY *.cabal /mnt
WORKDIR /mnt
RUN rm -rf ~/.stack && \
stack config set system-ghc --global true && \
stack setup && \
stack install --split-objs --ghc-options="-fPIC -fllvm" --only-dependencies
COPY . /mnt
RUN echo ' ld-options: -static' >> mail-utils.cabal ; \
stack install --split-objs --ghc-options="-fPIC -fllvm"
FROM alpine:3.12 as runner
MAINTAINER github@erebe.eu
WORKDIR /root
COPY --from=builder /root/.local/bin/hmailclassifier .
RUN chmod +x ./hmailclassifier
CMD ["./hmailclassifier"]