haskell official docker image

Haskell is an advanced purely-functional programming language.

Supported tags and respective Dockerfile links

For more information about this image and its history, please see the relevant manifest file (library/haskell) in the docker-library/official-images GitHub repo.

What is Haskell?

Haskell is a lazy, functional, statically-typed programming language with advanced type system features such as higher-rank, higher-kinded parametric polymorphism, monadic effects, generalized algebraic data types (GADTs), flexible type classes, associated type families, and more.

Haskell's ghc is a portable, optimizing compiler with a foreign-function interface (FFI), an LLVM backend, and sophisticated runtime support for concurrency, explicit/implicit parallelism, runtime profiling, etc. Other Haskell tools like criterion, quickcheck, hpc, and haddock provide advanced benchmarking, property-based testing, code coverage, and documentation generation.

A large number of production-quality Haskell libraries are available from Hackage. The cabal tool fetches packages and builds projects using the Hackage ecosystem.

logo

About this image

This image ships a minimal Haskell toolchain with the following packages from the hvr PPA:

  • ghc
  • alex
  • cabal-install
  • happy

The most recent GHC release in the 7.8 series is also available, though no longer receiving updates from upstream, so users are encouraged to upgrade to 7.10.

How to use this image

Start an interactive interpreter session with ghci:

$ docker run -it --rm haskell:7.10
GHCi, version 7.10.1: http://www.haskell.org/ghc/  :? for help
Prelude>

Dockerize a Hackage app with a Dockerfile inheriting from the base image:

FROM haskell:7.8
RUN cabal update && cabal install MazesOfMonad
VOLUME /root/.MazesOfMonad
ENTRYPOINT ["/root/.cabal/bin/mazesofmonad"]

Iteratively develop then ship a Haskell app with a Dockerfile utilizing the build cache:

FROM haskell:7.8

RUN cabal update

# Add .cabal file
ADD ./server/snap-example.cabal /opt/server/snap-example.cabal

# Docker will cache this command as a layer, freeing us up to
# modify source code without re-installing dependencies
RUN cd /opt/server && cabal install --only-dependencies -j4

# Add and Install Application Code
ADD ./server /opt/server
RUN cd /opt/server && cabal install

# Add installed cabal executables to PATH
ENV PATH /root/.cabal/bin:$PATH

# Default Command for Container
WORKDIR /opt/server
CMD ["snap-example"]

Examples

See the application snippet above in more detail in the example snap application.

License

This image is licensed under the MIT License (see LICENSE), and includes software licensed under the Glasgow Haskell Compiler License (BSD-style).

Supported Docker versions

This image is officially supported on Docker version 1.6.2.

Support for older versions (down to 1.0) is provided on a best-effort basis.


Docker, Inc is the company behind the open source Docker platform and the growing Docker ecosystem of contributors, partners and adopters revolutionizing the way distributed applications are built, shipped, and run.



Website: docker.com

Docker Registery: Haskell Official Docker Image




Copyright (c) 2014-2015 Docker, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Login to View or Leave Comments

Container
Converse with your fellow Users in the Automic Community.

Updated:
May 14, 2015