Using the Docker-Haskell Official Image
Prerequisites: an install of Docker (If you don’t want an install, Digital Ocean also has a Docker Droplet).
To start a ghci we can pull and run the image tagged as
7.8, which contains alex, happy, cabal and ghc-7.8.3:
docker pull haskell:7.8docker run -it haskell:7.8
quitting the repl (
:q) will also kill the container.
Building a Dockerfile
We can base a new project’s Dockerfile off of the
haskell:7.8 base. As it happens, there is an example Snap project in the docker-haskell project, in the
If we clone the repo and cd into the example project’s folder we can build the Dockerfile:
git clone firstname.lastname@example.org:darinmorrison/docker-haskell.gitcd docker-haskell/examples/7.8.3/snapdocker build -t my-new-project .
and run it:
docker run -itp 8000:8000 my-new-project
We can now see a Snap application running on port 8000 of either
localhost or our
Join the Newsletter
My newsletter is where you'll find exclusive content from me. I write about technology, startups, and why you shouldn't call yourself a junior engineer