-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (19 loc) · 781 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (19 loc) · 781 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
FROM debian:bookworm as builder
RUN apt-get update && apt-get install --no-install-recommends -y clang llvm libx11-dev libxss-dev libxrandr-dev pkg-config haskell-stack
COPY stack.yaml /mnt
COPY *.cabal /mnt
WORKDIR /mnt
RUN rm -rf ~/.stack && \
stack upgrade && \
stack config set system-ghc --global true && \
stack install --ghc-options="-fPIC" --only-dependencies
COPY . /mnt
# Hack as no Xss static lib on alpine, we don't need it
RUN echo ' ld-options: -static -Wl,--unresolved-symbols=ignore-all' >> greenclip.cabal ; \
stack install --ghc-options="-fPIC"
#RUN upx --ultra-brute /root/.local/bin/greenclip
FROM debian:bookworm as runner
WORKDIR /root
COPY --from=builder /root/.local/bin/greenclip .
RUN chmod +x ./greenclip
CMD ["./greenclip"]