Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. FROM haskell:7.10
  2. MAINTAINER Greg Weber
  3. # Intended as a development environment
  4. #
  5. # docker build -t yesod .
  6. # docker run --rm -i -t -v `pwd`:/home/haskell yesod /bin/bash
  7. # stackage update
  8. #
  9. RUN apt-get update && apt-get install sudo \
  10. # ssl stuff that you may find useful
  11. && apt-get install -y libssl-dev ca-certificates libcurl4-openssl-dev \
  12. # stackage-cli uses git. authbind can be useful for exposing ports
  13. && apt-get install -y git authbind \
  14. && apt-get clean
  15. # run as a user named "haskell"
  16. RUN useradd -m -d /home/haskell -s /bin/bash haskell
  17. RUN mkdir -p /etc/sudoers.d && echo "haskell ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/haskell && chmod 0440 /etc/sudoers.d/haskell
  18. ENV HOME /home/haskell
  19. WORKDIR /home/haskell
  20. USER haskell
  21. ENV LANG C.UTF-8
  22. ENV LC_ALL C.UTF-8
  23. # install stackage binaries to /opt/stackage
  24. RUN sudo mkdir -p /opt/stackage/bin
  25. ENV PATH /opt/stackage/bin:.cabal-sandbox/bin:.cabal/bin:$PATH:./
  26. RUN sudo chown haskell:haskell /opt/stackage/bin
  27. RUN cabal update \
  28. && cabal install stackage-update && stackage-update \
  29. && cabal install stackage-install \
  30. && stackage-install stackage-cli stackage-cabal stackage-sandbox stackage-upload \
  31. && mv /home/haskell/.cabal/bin/* /opt/stackage/bin/ \
  32. && rm -r /home/haskell/.cabal