-
Notifications
You must be signed in to change notification settings - Fork 396
/
Copy pathDockerfile
74 lines (66 loc) · 1.92 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM alpine:3.18.9
# Based on https://github.com/fpco/alpine-haskell-stack/blob/9.2.8v2/ghc-Dockerfile
RUN apk upgrade --no-cache &&\
apk add --no-cache \
curl \
gcc \
git \
libc-dev \
xz \
gmp-dev \
autoconf \
automake \
binutils \
build-base \
coreutils \
cpio \
linux-headers \
libffi-dev \
musl-dev \
zlib-dev \
zlib-static \
ncurses-dev \
ncurses-libs \
ncurses-static \
bash \
lld \
shadow # for stack --docker, provides groupadd
RUN curl -sSLo /usr/local/bin/stack https://github.com/commercialhaskell/stack/releases/download/v3.1.1/stack-3.1.1-linux-x86_64-bin && \
chmod +x /usr/local/bin/stack
# https://stackoverflow.com/a/41517423
RUN ln -s /usr/lib/libncurses.a /usr/lib/libtinfo.a
COPY stack-config.yaml /root/.stack/config.yaml
RUN cd /tmp && \
curl -sSLo /tmp/ghc.tar.xz https://downloads.haskell.org/~ghc/9.8.2/ghc-9.8.2-x86_64-alpine3_12-linux.tar.xz && \
tar xf ghc.tar.xz && \
cd ghc-9.8.2-x86_64-unknown-linux && \
./configure --prefix=/usr/local && \
make install && \
rm -rf /tmp/ghc.tar.xz /tmp/ghc-9.8.2-x86_64-unknown-linux
RUN apk upgrade --no-cache &&\
apk add --no-cache \
cmake \
libtool \
openssl-dev \
tar \
zlib-dev \
zlib-static
RUN addgroup \
--gid 115 \
runneruser \
&& \
adduser \
--disabled-password \
--gecos "" \
--ingroup runneruser \
--home /github/home \
--uid 1001 \
runneruser
RUN mkdir -p /etc/stack &&\
{ cat /root/.stack/config.yaml ;\
echo "system-ghc: true" ;\
echo "install-ghc: false" ;\
echo "skip-ghc-check: true" ;\
} >> /etc/stack/config.yaml &&\
chmod 664 /etc/stack/config.yaml &&\
chown root:runneruser /etc/stack/config.yaml