on master help sign in
Install GHC via Stack
a4b8cf4Michael Snoyman
Dockerfile+3−1
@@ -2,9 +2,11 @@ FROM fpco/pid1:18.04
2
2
3ENV HOME /home/stackage
3ENV HOME /home/stackage
4ENV LANG en_US.UTF-8
4ENV LANG en_US.UTF-8
5+ENV GHCVER 8.6.4
6+ENV GHCDIR /home/stackage/.stack/programs/x86_64-linux/ghc-$GHCVER
5
7
6# NOTE: also update debian-bootstrap.sh when cuda version changes
8# NOTE: also update debian-bootstrap.sh when cuda version changes
7−ENV PATH /usr/local/cuda-10.0/bin:/opt/ghc/8.6.4/bin:/usr/sbin:/usr/bin:/sbin:/bin
9+ENV PATH /usr/local/cuda-10.0/bin:/home/stackage/.stack/programs/x86_64-linux/ghc-$GHCVER:/usr/sbin:/usr/bin:/sbin:/bin
8ENV CUDA_PATH /usr/local/cuda-10.0
10ENV CUDA_PATH /usr/local/cuda-10.0
9
11
10ADD debian-bootstrap.sh /tmp/debian-bootstrap.sh
12ADD debian-bootstrap.sh /tmp/debian-bootstrap.sh
debian-bootstrap.sh+14−15
@@ -10,13 +10,21 @@
10# instructions, see:
10# instructions, see:
11# http://www.stackage.org/install
11# http://www.stackage.org/install
12
12
13−set -exu
13+set -exuo pipefail
14
14
15mkdir -p /home/stackage
15mkdir -p /home/stackage
16
16
17export LANG=C.UTF-8
17export LANG=C.UTF-8
18export DEBIAN_FRONTEND=noninteractive
18export DEBIAN_FRONTEND=noninteractive
19
19
20+# Get curl
21+apt-get update
22+apt-get install -y curl
23+
24+# Get Stack and GHC
25+curl -sSL https://get.haskellstack.org/ | sh -s - -d /usr/bin
26+stack setup --resolver ghc-$GHCVER
27+
20apt-get update
28apt-get update
21
29
22apt-get install -y \
30apt-get install -y \
@@ -146,11 +154,6 @@ apt-get install -y \
146 zlib1g-dev \
154 zlib1g-dev \
147 zsh
155 zsh
148
156
149−GHCVER=8.6.4
150−
151−add-apt-repository ppa:hvr/ghc -y
152−apt-get install -y ghc-$GHCVER ghc-$GHCVER-dyn ghc-$GHCVER-htmldocs ghc-$GHCVER-prof
153−
154# odbc
157# odbc
155curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
158curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
156curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
159curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
@@ -159,11 +162,6 @@ ACCEPT_EULA=Y apt-get install msodbcsql17 -y
159
162
160locale-gen en_US.UTF-8
163locale-gen en_US.UTF-8
161
164
162−curl -sSL https://get.haskellstack.org/ | sh
163−
164−# Put documentation where we expect it
165−mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc
166−
167# llvm-7.0 for llvm-hs (separate since it needs wget)
165# llvm-7.0 for llvm-hs (separate since it needs wget)
168wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
166wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
169 && add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main" \
167 && add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main" \
@@ -258,10 +256,6 @@ apt-add-repository multiverse \
258export CLANG_PURE_LLVM_LIB_DIR=/usr/lib/llvm-6.0/lib;
256export CLANG_PURE_LLVM_LIB_DIR=/usr/lib/llvm-6.0/lib;
259export CLANG_PURE_LLVM_INCLUDE_DIR=/usr/lib/llvm-6.0/include;
257export CLANG_PURE_LLVM_INCLUDE_DIR=/usr/lib/llvm-6.0/include;
260
258
261−# finally run:
262−ldconfig
263−# EOF: don't build anything below this line
264−
265# protoc, for proto-lens-combinators test suite
259# protoc, for proto-lens-combinators test suite
266# Instructions from: https://google.github.io/proto-lens/installing-protoc.html
260# Instructions from: https://google.github.io/proto-lens/installing-protoc.html
267PROTOC_ZIP=protoc-3.3.0-linux-x86_64.zip
261PROTOC_ZIP=protoc-3.3.0-linux-x86_64.zip
@@ -278,3 +272,8 @@ echo /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server > /etc/ld.so.conf.d/
278echo /usr/lib/llvm-3.7/lib > /etc/ld.so.conf.d/llvm.conf
272echo /usr/lib/llvm-3.7/lib > /etc/ld.so.conf.d/llvm.conf
279
273
280ldconfig
274ldconfig
275+# EOF: don't build anything below this line
276+
277+# Cleanup
278+apt-get clean
279+rm -rf /var/lib/apt/lists/*