Skip to content

Commit

Permalink
Run update.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
docker-library-bot committed May 8, 2020
1 parent 0e4d48d commit 741db1e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions haskell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,22 @@ WARNING:

[Haskell](http://www.haskell.org) is a [lazy](http://en.wikibooks.org/wiki/Haskell/Laziness), functional, statically-typed programming language with advanced type system features such as higher-rank, higher-kinded parametric [polymorphism](http://en.wikibooks.org/wiki/Haskell/Polymorphism), monadic [effects](http://en.wikibooks.org/wiki/Haskell/Understanding_monads/IO), generalized algebraic data types ([GADT](http://en.wikibooks.org/wiki/Haskell/GADT)s), flexible [type classes](http://en.wikibooks.org/wiki/Haskell/Advanced_type_classes), associated [type families](http://en.wikipedia.org/wiki/Type_family), and more.

Haskell's [`ghc`](http://www.haskell.org/ghc) is a [portable](https://ghc.haskell.org/trac/ghc/wiki/Platforms), [optimizing](http://benchmarksgame.alioth.debian.org/u64q/haskell.php) compiler with a foreign-function interface ([FFI](http://en.wikibooks.org/wiki/Haskell/FFI)), an [LLVM backend](https://www.haskell.org/ghc/docs/7.8.3/html/users_guide/code-generators.html), and sophisticated runtime support for [concurrency](http://en.wikibooks.org/wiki/Haskell/Concurrency), explicit/implicit [parallelism](https://simonmar.github.io/pages/pcph.html), runtime [profiling](http://www.haskell.org/haskellwiki/ThreadScope), etc. Other Haskell tools like [`criterion`](http://www.serpentine.com/criterion/tutorial.html), [`quickcheck`](https://www.fpcomplete.com/user/pbv/an-introduction-to-quickcheck-testing), [`hpc`](http://www.haskell.org/haskellwiki/Haskell_program_coverage#Examples), and [`haddock`](http://en.wikipedia.org/wiki/Haddock_%28software%29) provide advanced benchmarking, property-based testing, code coverage, and documentation generation.
Haskell's [`ghc`](http://www.haskell.org/ghc) is a [portable](https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms), optimizing compiler with a foreign-function interface ([FFI](http://en.wikibooks.org/wiki/Haskell/FFI)), an LLVM backend, and sophisticated runtime support for [concurrency](http://en.wikibooks.org/wiki/Haskell/Concurrency), explicit/implicit [parallelism](https://simonmar.github.io/pages/pcph.html), runtime [profiling](http://www.haskell.org/haskellwiki/ThreadScope), 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](https://hackage.haskell.org) in the form of [Cabal](https://www.haskell.org/cabal/) packages. The traditional [`cabal`](https://www.fpcomplete.com/user/simonmichael/how-to-cabal-install) tool, or the more recent [`stack`](http://docs.haskellstack.org/en/stable/README.html) tool (available in `7.10.3`+) can be used to streamline working with Cabal packages. The key differences are summarized [here](https://www.fpcomplete.com/blog/2015/06/why-is-stack-not-cabal). New users are encouraged to start with `stack`.
A large number of production-quality Haskell libraries are available from [Hackage](https://hackage.haskell.org) in the form of [Cabal](https://www.haskell.org/cabal/) packages. The traditional `cabal` tool, or the more recent [`stack`](http://docs.haskellstack.org/en/stable/README.html) tool (available in `7.10.3`+) can be used to streamline working with Cabal packages.

![logo](https://raw.githubusercontent.com/docker-library/docs/53e03448d5c2c33124ce24609f6179ddc94873f4/haskell/logo.png)

## About this image

This image ships a minimal Haskell toolchain (`ghc` and `cabal-install`) from the upstream [downloads.haskell.org](https://launchpad.net/~hvr/+archive/ubuntu/ghc) Debian repository as well as the Stack tool ([https://www.haskellstack.org/](https://www.haskellstack.org/)).
This image ships a minimal Haskell toolchain (`ghc` and `cabal-install`) from the upstream [downloads.haskell.org](https://launchpad.net/~hvr/+archive/ubuntu/ghc) Debian repository as well as the `stack` tool ([https://www.haskellstack.org/](https://www.haskellstack.org/)).

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 two most recent minor releases will receive updates or be shown in the "Supported tags ..." section at the top of this page.

Additionally, we support the two most versions of Debian (`stable` and `oldstable`) as variants, with the most recent being the default if not specified.

> Note: `haskell:8.8.3` was updated from Debian Stretch to Buster, so you will need to specify `haskell:8.8.3-stretch` to stick with Stretch in this particular case.
## How to use this image

Start an interactive interpreter session with `ghci`:
Expand All @@ -74,15 +78,15 @@ GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help
Prelude>
```

Dockerize an application from Hackage with a `Dockerfile`:
Dockerize an application using `stack`:

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

Alternatively, using `cabal`:
Dockerize an application using `cabal`:

```dockerfile
FROM haskell:8
Expand All @@ -93,40 +97,36 @@ ENTRYPOINT ["pandoc"]
Iteratively develop a Haskell application with a `Dockerfile` utilizing the build cache:

```dockerfile
FROM haskell:7.10
FROM haskell:8

WORKDIR /opt/server
WORKDIR /opt/example

RUN cabal update

# Add just the .cabal file to capture dependencies
COPY ./snap-example.cabal /opt/server/snap-example.cabal
COPY ./example.cabal /opt/example/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
COPY . /opt/example
RUN cabal install

CMD ["snap-example"]
CMD ["example"]
```

### Examples

See the application snippet above in more detail in the [example snap application](https://github.com/haskell/docker-haskell/tree/master/examples/7.10/snap).

### Considerations for `happy`, `alex`, etc

Some packages that also act as build dependencies, such as `happy` and `alex`, are no longer included in this image (as of `haskell:8.2.2` & `haskell:8.4.3`). There is a bootstrapping problem where one or more of these tools may be assumed to be available. If you run in to an error about missing dependencies that are not explicitly called out in a Cabal package, you will need to explicitly mark them for installation.

### Considerations for Stack

The Stack tool is primarily designed to run directly on the host and comes with many advanced features such as GHC bootstrapping and Docker integration. Within the context of a container image, some of these features clash with the Docker abstraction and should be avoided. Another common scenario that can be confusing is the default Stackage snapshot.
The Stack tool is primarily designed to run directly on the host and comes with many advanced features such as GHC bootstrapping and Docker integration. Within the context of a container image, some of these features (`stack docker`) clash with the Docker abstraction and should be avoided.

A Stackage snapshot is a collection of Haskell packages pinned to specific versions for compatibility with a particular GHC release. When you ask Stack to resolve dependencies it refers to a particular snapshot via the `resolver` value. While you should be specifying a `resolver` explicitly in your projects, it is possible to run with the auto-generated default. That default is determined by the value obtained from the upstream Stackage server at the time it was requested, and points to the latest "LTS" snapshot. If the snapshot refers to a different version of GHC than is provided in the Docker image, you may see a message like the following:
Another common scenario that can be confusing is the default Stackage snapshot. A Stackage snapshot is a collection of Haskell packages pinned to specific versions for compatibility with a particular GHC release. When you ask Stack to resolve dependencies it refers to a particular snapshot via the `resolver` value. While you should be specifying a `resolver` explicitly in your projects, it is possible to run with the auto-generated default. That default is determined by the value obtained from the [upstream Stackage server](https://www.stackage.org/) at the time it was requested, and points to the latest "LTS" snapshot. If the snapshot refers to a different version of GHC than is provided in the Docker image, you may see a message like the following:

```console
Step 2/3 : RUN stack install pandoc
Expand All @@ -152,7 +152,7 @@ Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpc
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
```

The alternative to use `--install-ghc` doesn't make sense in a Docker image context, and in fact the global `install-ghc` flag has been set to `false` (as of `haskell:8.2.2` & `haskell:8.4.3`) to avoid the default behavior of bootstrapping a new GHC in the container.
The alternative to use `--install-ghc` doesn't make sense in a Docker image context, and hence the global `install-ghc` flag has been set to `false` (as of `haskell:8.2.2` & `haskell:8.4.3`) to avoid the default behavior of bootstrapping a new GHC in the container.

# License

Expand Down
6 changes: 3 additions & 3 deletions nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ WARNING:
- [`18.0.4-apache`, `18.0-apache`, `18-apache`, `apache`, `stable-apache`, `18.0.4`, `18.0`, `18`, `latest`, `stable`](https://github.com/nextcloud/docker/blob/b1825a188ba1918aa30d0b6ac18d0a32ff3ec707/18.0/apache/Dockerfile)
- [`18.0.4-fpm-alpine`, `18.0-fpm-alpine`, `18-fpm-alpine`, `fpm-alpine`, `stable-fpm-alpine`](https://github.com/nextcloud/docker/blob/b1825a188ba1918aa30d0b6ac18d0a32ff3ec707/18.0/fpm-alpine/Dockerfile)
- [`18.0.4-fpm`, `18.0-fpm`, `18-fpm`, `fpm`, `stable-fpm`](https://github.com/nextcloud/docker/blob/b1825a188ba1918aa30d0b6ac18d0a32ff3ec707/18.0/fpm/Dockerfile)
- [`19.0.0beta7-apache`, `19.0.0-beta-apache`, `19.0-beta-apache`, `19-beta-apache`, `19.0.0beta7`, `19.0.0-beta`, `19.0-beta`, `19-beta`](https://github.com/nextcloud/docker/blob/764c79de08b3eaf70ef3cfee1f784f21e7d1f00d/19.0-beta/apache/Dockerfile)
- [`19.0.0beta7-fpm-alpine`, `19.0.0-beta-fpm-alpine`, `19.0-beta-fpm-alpine`, `19-beta-fpm-alpine`](https://github.com/nextcloud/docker/blob/764c79de08b3eaf70ef3cfee1f784f21e7d1f00d/19.0-beta/fpm-alpine/Dockerfile)
- [`19.0.0beta7-fpm`, `19.0.0-beta-fpm`, `19.0-beta-fpm`, `19-beta-fpm`](https://github.com/nextcloud/docker/blob/764c79de08b3eaf70ef3cfee1f784f21e7d1f00d/19.0-beta/fpm/Dockerfile)
- [`19.0.0RC1-apache`, `19.0.0-rc-apache`, `19.0-rc-apache`, `19-rc-apache`, `19.0.0RC1`, `19.0.0-rc`, `19.0-rc`, `19-rc`](https://github.com/nextcloud/docker/blob/05c3a27d349566e8d3b79797b7300ab1e1bb6a79/19.0-rc/apache/Dockerfile)
- [`19.0.0RC1-fpm-alpine`, `19.0.0-rc-fpm-alpine`, `19.0-rc-fpm-alpine`, `19-rc-fpm-alpine`](https://github.com/nextcloud/docker/blob/05c3a27d349566e8d3b79797b7300ab1e1bb6a79/19.0-rc/fpm-alpine/Dockerfile)
- [`19.0.0RC1-fpm`, `19.0.0-rc-fpm`, `19.0-rc-fpm`, `19-rc-fpm`](https://github.com/nextcloud/docker/blob/05c3a27d349566e8d3b79797b7300ab1e1bb6a79/19.0-rc/fpm/Dockerfile)

# Quick reference (cont.)

Expand Down

0 comments on commit 741db1e

Please sign in to comment.