From 44cba232b7813e6eb08c9a5acb449dfa9001af56 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 6 Jan 2015 11:33:44 +0200 Subject: [PATCH] Try out a Docker build --- .dockerignore | 7 +++++++ Dockerfile | 27 +++++++++++++++++++++++++++ debian-bootstrap.sh | 8 ++++---- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..e09d9880 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +dist +builds +logs +.cabal-sandbox +cabal.sandbox.config +tarballs +*.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..5a7aa4d3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:12.04 + +ENV HOME /home/stackage +ENV LANG en_US.UTF-8 + +RUN mkdir /home/stackage -p +RUN locale-gen en_US.UTF-8 + +RUN DEBIAN_FRONTEND=noninteractive apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common python-software-properties +RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:hvr/ghc -y + +ADD debian-bootstrap.sh /tmp/debian-bootstrap.sh +RUN DEBIAN_FRONTEND=noninteractive bash /tmp/debian-bootstrap.sh +RUN rm /tmp/debian-bootstrap.sh + +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install-1.20 ghc-7.8.4 + +ENV PATH /opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +RUN cabal update +ADD . /tmp/stackage +RUN cd /tmp/stackage && cabal install +RUN cp $HOME/.cabal/bin/stackage /usr/local/bin +RUN rm -rf $HOME/.cabal $HOME/.ghc /tmp/stackage + +RUN cd /home/stackage && cabal update && stackage nightly diff --git a/debian-bootstrap.sh b/debian-bootstrap.sh index 50177b28..2e423c25 100755 --- a/debian-bootstrap.sh +++ b/debian-bootstrap.sh @@ -10,10 +10,10 @@ # instructions, see: # http://www.stackage.org/install -sudo add-apt-repository -y ppa:chris-lea/zeromq -sudo add-apt-repository -y ppa:floe/libtisch -sudo apt-get update -sudo apt-get install -y \ +add-apt-repository -y ppa:chris-lea/zeromq +add-apt-repository -y ppa:floe/libtisch +apt-get update +apt-get install -y \ build-essential \ libncurses-dev \ git \