Skip to content

Instantly share code, notes, and snippets.

@jackgris
Forked from necrobious/gist:14d78ee9b4caff766152
Last active April 29, 2021 23:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackgris/a62b65d673c6f8cf05fb to your computer and use it in GitHub Desktop.
Save jackgris/a62b65d673c6f8cf05fb to your computer and use it in GitHub Desktop.
How install GHC and Cabal on Ubuntu
# build with
# docker build -t 'necrobious/haskell-ghc-7.8-64' .
FROM ubuntu:14.04
MAINTAINER necrobious@gmail.com
ENV DEBIAN_FRONTEND noninteractive
####### Install Dependencies ###################################################
RUN apt-get -y update
RUN apt-get -y install build-essential curl zlib1g-dev libgmp3-dev libedit2
####### GHC 7.8.3 offical ######################################################
RUN curl -O http://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2
RUN tar xvfj ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2
RUN cd ghc-7.8.3 && ./configure
RUN cd ghc-7.8.3 && make install
RUN ghc --version
######### cabal-install ########################################################
RUN curl -O http://hackage.haskell.org/package/cabal-install-1.20.0.3/cabal-install-1.20.0.3.tar.gz
RUN tar xvfz cabal-install-1.20.0.3.tar.gz
RUN (cd cabal-install-1.20.0.3 && ./bootstrap.sh)
ENV PATH /.cabal/bin:$PATH
ENV LANG C.UTF-8
######### Clean up #############################################################
RUN rm -fr ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2 ghc-7.8.3
RUN rm -fr cabal-install-1.20.0.3*
## Ubuntu problems with install packages (previus installed)
sudo cabal --upgrade-dependencies install "name package"
## For example: sudo cabal --upgrade-dependencies install github
cabal install --reinstall --enable-shared "package name"
@mzfr
Copy link

mzfr commented Mar 3, 2019

There's issue in getting the files from curl since doing RUN curl -O http://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2 actually return an HTML page instead of bzip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment