forked from gelisam/deploy-hint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwith-ghc.docker
More file actions
52 lines (47 loc) · 3.69 KB
/
with-ghc.docker
File metadata and controls
52 lines (47 loc) · 3.69 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
41
42
43
44
45
46
47
48
49
50
51
52
## Dockerfile for building a haskell program
FROM haskell:7.10.3
MAINTAINER Samuel Gélineau <gelisam@gmail.com>
WORKDIR /root
COPY my-program.cabal /root/my-program.cabal
COPY Setup.hs /root/Setup.hs
COPY customized-hint /root/customized-hint
RUN cabal update && \
cabal sandbox init && \
cabal sandbox add-source customized-hint && \
cabal install --only-dependencies
RUN mkdir -p my-program/c-libs && \
cp /usr/lib/x86_64-linux-gnu/libgmp.so.10 my-program/c-libs/ && \
ln -s libgmp.so.10 my-program/c-libs/libgmp.so && \
mkdir -p my-program/haskell-libs && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/rts my-program/haskell-libs/ && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/base_* my-program/haskell-libs/ && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/ghcpr_* my-program/haskell-libs/ && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/integ_* my-program/haskell-libs/ && \
cp -r .cabal-sandbox/lib/x86_64-linux-ghc-7.10.3/acme-dont-* my-program/haskell-libs/ && \
mkdir -p my-program/haskell-libs/package.conf.d && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/package.conf.d/builtin_rts.conf my-program/haskell-libs/package.conf.d && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/package.conf.d/base-*.conf my-program/haskell-libs/package.conf.d/ && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/package.conf.d/ghc-prim-*.conf my-program/haskell-libs/package.conf.d/ && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/package.conf.d/integer-gmp-*.conf my-program/haskell-libs/package.conf.d/ && \
cp -r .cabal-sandbox/*-packages.conf.d/acme-dont-*.conf my-program/haskell-libs/package.conf.d/ && \
sed -i 's/\/opt\/ghc\/7.10.3\/lib\/ghc-7.10.3/haskell-libs/g' \
my-program/haskell-libs/package.conf.d/builtin_rts.conf && \
sed -i 's/\/opt\/ghc\/7.10.3\/lib\/ghc-7.10.3/haskell-libs/g' \
my-program/haskell-libs/package.conf.d/base-*.conf && \
sed -i 's/\/opt\/ghc\/7.10.3\/lib\/ghc-7.10.3/haskell-libs/g' \
my-program/haskell-libs/package.conf.d/ghc-prim-*.conf && \
sed -i 's/\/opt\/ghc\/7.10.3\/lib\/ghc-7.10.3/haskell-libs/g' \
my-program/haskell-libs/package.conf.d/integer-gmp-*.conf && \
sed -i 's/\/root\/.cabal-sandbox\/lib\/x86_64-linux-ghc-7.10.3/haskell-libs/g' \
my-program/haskell-libs/package.conf.d/acme-dont-*.conf && \
ghc-pkg --package-db=my-program/haskell-libs/package.conf.d recache && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/platformConstants my-program/haskell-libs/ && \
cp -r /opt/ghc/7.10.3/lib/ghc-7.10.3/settings my-program/haskell-libs/ && \
sed -i 's/\/usr\/bin\/gcc/bin\/fake_gcc.sh/g' my-program/haskell-libs/settings && \
mkdir -p my-program/bin
COPY fake_gcc.sh /root/my-program/bin/fake_gcc.sh
COPY src /root/src
RUN cabal install && \
cp .cabal-sandbox/bin/my-program my-program/ && \
tar czvf my-program.tar.gz my-program
CMD ["cd my-program;./my-program"]