Skip to content
OpenShift/S2I builder for Haskell
Shell Dockerfile Haskell
Branch: master
Clone or download
Latest commit 384fb66 Aug 22, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
image builder: parameterise ghc version Jan 13, 2019
test-server builder tests: decouple from template Jan 21, 2019
.gitignore move to github Aug 22, 2019
LICENSE license: GPL Jun 19, 2016 move to github Aug 22, 2019
build builder: parameterise ghc version Jan 13, 2019
test builder tests: decouple from template Jan 21, 2019

Haskell Cloud

Haskell Cloud is a Source-to-Image builder for building Haskell source into a runnable Docker image. It can be used directly with s2i, or deployed on OpenShift.


These examples use the sample repository.


Download S2I from GitHub, and build an image with:

s2i build --rm accursoft/ghc haskell-cloud

The resulting image can be run with:

docker run --name haskell-cloud -d -p 8080:8080 haskell-cloud

See it in action:

curl localhost:8080


Download the CLI from your OpenShift console, and follow the instructions for logging in. Create a project (through the console or CLI) if you do not already have one, and select it with oc project.

To create the application:

oc new-app accursoft/ghc~ --name="haskell-cloud"

To see it in action, create a route from the console, or oc expose service haskell-cloud. Note that it can take a few minutes for OpenShift to begin routing traffic.

Incremental Builds

Incremental builds re-use compiled dependencies and the hackage index from the previous build.

  • s2i: Pass the --incremental flag to s2i build.
  • OpenShift: oc patch buildconfig haskell-cloud -p '{"spec":{"strategy":{"sourceStrategy":{"incremental":true}}}}'

Old packages are never removed from incremental builds, so an occasional clean build may be required to avoid image bloat.

Apply the cabal_update marker (see below) to force cabal update before incremental builds.


The application's cabal file must define an executable called server, which listens on port 8080. This is provided as the PORT environment variable and as a command line argument.

Markers and Hooks

Markers and hooks can be created in .s2i/ to modify the build process.

You can’t perform that action at this time.