Official Repository

Last pushed: 4 days ago
Short Description
Haskell is an advanced purely-functional programming language.
Full Description

Supported tags and respective Dockerfile links

For more information about this image and its history, please see the relevant manifest file (library/haskell). This image is updated via pull requests to the docker-library/official-images GitHub repo.

For detailed information about the virtual/transfer sizes and individual layers of each of the above supported tags, please see the repos/haskell/tag-details.md file in the docker-library/repo-info 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 in the form of Cabal packages. The traditional cabal tool, or the more recent stack tool (available in 7.10.3+) can be used to streamline working with Cabal packages. The key differences are summarized here. New users are encouraged to start with stack.

About this image

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

  • ghc
  • alex
  • cabal-install
  • happy

As of 7.10.3, the stack tool is included.

Note: The GHC developers do not support legacy release branches (i.e. 7.8.x). While older GHC release tags are available in this DockerHub repository, only the latest stable release (or upcoming release candidates) will be shown in the "Supported tags ..." section at the top of this page.

How to use this image

Start an interactive interpreter session with ghci:

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

Dockerize an application from Hackage with a Dockerfile:

FROM haskell:8
RUN stack install pandoc pandoc-citeproc
ENTRYPOINT ["pandoc"]

Alternatively, using cabal:

FROM haskell:8
RUN cabal update && cabal install pandoc pandoc-citeproc
ENTRYPOINT ["pandoc"]

Iteratively develop a Haskell application with a Dockerfile utilizing the build cache:

FROM haskell:7.10

WORKDIR /opt/server

RUN cabal update

# Add just the .cabal file to capture dependencies
COPY ./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
# (unless the .cabal file changes!)
RUN cabal install --only-dependencies -j4

# Add and Install Application Code
COPY . /opt/server
RUN cabal install

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 17.03.0-ce.

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

Please see the Docker installation documentation for details on how to upgrade your Docker daemon.

User Feedback

Issues

If you have any problems with or questions about this image, please contact us through a GitHub issue. If the issue is related to a CVE, please check for a cve-tracker issue on the official-images repository first.

You can also reach many of the official image maintainers via the #docker-library IRC channel on Freenode.

Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

Documentation

Documentation for this image is stored in the haskell/ directory of the docker-library/docs GitHub repo. Be sure to familiarize yourself with the repository's README.md file before attempting a pull request.

Docker Pull Command

Comments (10)
fokot
3 months ago

+1 image based on alpine

ramirio
7 months ago

An image based on a alpine image would be great

fabella
9 months ago

+1 Stack

Thanks

markmynsted
a year ago

+1 stack

softsapiens
a year ago

+1 stack

Thanks!

unitymind
a year ago

Could you update to latest 7.10.3 version of GHC?

pierrer
a year ago

+1 for stack support.

huiwang
2 years ago

do you have plans to include the stack tool ?

s2r2
2 years ago

@ysangkok: this links from the README points to revisions in freebroccolo's docker-haskell github repo, which in turn includes the Dockerfiles with the references you're looking for.

ysangkok
2 years ago

How can I find out which images these images are based on?