diff --git a/Dockerfile b/Dockerfile index 86eb581b..68c3da1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,10 @@ FROM fpco/pid1:16.04 ENV HOME /home/stackage ENV LANG en_US.UTF-8 +ENV GHCVER 8.6.4 # NOTE: also update debian-bootstrap.sh when cuda version changes -ENV PATH /usr/local/cuda-10.0/bin:/opt/ghc/8.6.4/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH /home/stackage/.stack/programs/x86_64-linux/ghc-$GHCVER/bin:/usr/local/cuda-10.0/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV CUDA_PATH /usr/local/cuda-10.0 ENV LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:/usr/local/cuda-10.0/nvvm/lib64 diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh index 91e1efdd..bf79803b 100755 --- a/debian-bootstrap.sh +++ b/debian-bootstrap.sh @@ -10,11 +10,20 @@ # instructions, see: # http://www.stackage.org/install -set -exu +set -exuo pipefail mkdir /home/stackage -p export DEBIAN_FRONTEND=noninteractive + +# Get curl +apt-get update +apt-get install -y curl + +# Get Stack and GHC +curl -sSL https://get.haskellstack.org/ | sh -s - -d /usr/bin +stack setup --resolver ghc-$GHCVER + apt-get update apt-get install -y software-properties-common @@ -164,11 +173,6 @@ ACCEPT_EULA=Y apt-get install msodbcsql17 -y locale-gen en_US.UTF-8 -curl -sSL https://get.haskellstack.org/ | sh - -# Put documentation where we expect it -mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc - # llvm-5.0 for GHC (separate since it needs wget) wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ && add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main" \ @@ -304,3 +308,7 @@ export CLANG_PURE_LLVM_INCLUDE_DIR=/usr/lib/llvm-3.9/include; # finally run: ldconfig # EOF: don't build anything below this line + +# Cleanup +apt-get clean +rm -rf /var/lib/apt/lists/*