-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
67 lines (59 loc) · 2.07 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
FROM ubuntu:14.04
ENV HOME /root
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /root
RUN apt-get update
# ghc 7.8.3
RUN apt-get install -y openssh-server # so that bootstrap.sh and wget works without --no-check-certificate (?)
RUN apt-get install -y wget libgmp3-dev build-essential
RUN ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/libgmp.so.3
RUN ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/libgmp.so
RUN wget http://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-x86_64-unknown-linux-deb7.tar.xz
RUN tar xf ghc-7.8.3-x86_64-unknown-linux-deb7.tar.xz
RUN rm ghc-7.8.3-x86_64-unknown-linux-deb7.tar.xz
WORKDIR /root/ghc-7.8.3
RUN ./configure
RUN make install
WORKDIR /root
RUN rm -rf ghc-7.8.3
# cabal 1.20.0.2
RUN wget http://www.haskell.org/cabal/release/cabal-1.20.0.2/Cabal-1.20.0.2.tar.gz
RUN tar xf Cabal-1.20.0.2.tar.gz
RUN rm Cabal-1.20.0.2.tar.gz
WORKDIR Cabal-1.20.0.2
RUN ghc --make Setup
RUN ./Setup configure
RUN ./Setup build
RUN ./Setup install
WORKDIR /root
RUN rm -rf ./Cabal-1.20.0.2
WORKDIR /root
RUN wget http://www.haskell.org/cabal/release/cabal-install-1.20.0.2/cabal-install-1.20.0.2.tar.gz
RUN tar xf cabal-install-1.20.0.2.tar.gz
RUN rm cabal-install-1.20.0.2.tar.gz
WORKDIR cabal-install-1.20.0.2
RUN apt-get install -y zlib1g-dev
RUN ./bootstrap.sh
ENV PATH $HOME/.cabal/bin:$PATH
RUN cabal update
RUN echo "export PATH=~/.cabal/bin:$PATH" >> /root/.profile
WORKDIR /root
RUN rm -rf ./cabal-install-1.20.0.2
RUN cp ~/.cabal/config ~/.cabal/config.old
RUN sed -E 's/(-- )?(library-profiling: )False/\2True/' < ~/.cabal/config.old > ~/.cabal/config
RUN locale-gen en_US.UTF-8
RUN export LC_ALL='en_US.UTF-8'
ENV LC_ALL en_US.UTF-8
RUN cabal install -j happy
# install some dependencies
RUN apt-get install -y libpq-dev
# copy code to container
RUN mkdir -p /root/aws-redshift-to-rds
COPY src /root/aws-redshift-to-rds/src
COPY aws-redshift-to-rds.cabal /root/aws-redshift-to-rds/
COPY LICENSE /root/aws-redshift-to-rds/
WORKDIR /root/aws-redshift-to-rds
RUN cabal sandbox init
RUN cabal install
# copy config and credendtial files
COPY config /root/aws-redshift-to-rds/config