1
- ## Synopsis
1
+ ## What is Haskell?
2
2
3
- This docker image ships a minimal Haskell toolchain.
3
+ ![ image] ( https://github.com/darinmorrison/docker-haskell/blob/docker-library/logo.png?raw=true )
4
4
5
- ### Use Cases
5
+ Haskell is an advanced purely-functional programming language. An open-source
6
+ product of more than twenty years of cutting-edge research, it allows rapid
7
+ development of robust, concise, correct software. With strong support for
8
+ integration with other languages, built-in concurrency and parallelism,
9
+ debuggers, profilers, rich libraries and an active community, Haskell makes it
10
+ easier to produce flexible, maintainable, high-quality software.
6
11
7
- This image can be used in the following ways:
12
+ The Glorious Glasgow Haskell Compilation System (GHC) is a state-of-the-art,
13
+ open source, compiler and interactive environment for the functional language
14
+ Haskell. GHC includes an optimising compiler (` ghc ` ), an interactive
15
+ environment (` ghci ` ), and a convenient script runner (` runghc ` ).
8
16
9
- * ** As a containerized Haskell development environment **
17
+ > [ haskell.org ] ( http://www.haskell.org )
10
18
11
- * ** As a container in which to build and run Haskell apps locally or deploy remotely**
12
-
13
- * ** As a base image for other containers depending on the Haskell toolchain**
14
-
15
- ### Contents
19
+ > [ Glasgow Haskell Compiler] ( http://www.haskell.org/ghc )
16
20
17
21
The default configuration of this image provides the following packages:
18
22
@@ -22,3 +26,50 @@ The default configuration of this image provides the following packages:
22
26
| ` cabal-install ` | ` 1.20.0.3 ` |
23
27
| ` happy ` | ` 1.19.4 ` |
24
28
| ` ghc ` | ` 7.8.3 ` |
29
+
30
+ ## How to use this image
31
+
32
+ Directly run ` ghci ` .
33
+
34
+ $ docker run -it --rm haskell:7.8
35
+ GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help
36
+ Loading package ghc-prim ... linking ... done.
37
+ Loading package integer-gmp ... linking ... done.
38
+ Loading package base ... linking ... done.
39
+ Prelude>
40
+
41
+ Dockerize an application on Hackage with a Dockerfile that inherits from the
42
+ base image.
43
+
44
+ FROM haskell:7.8
45
+ RUN cabal update && cabal install MazesOfMonad
46
+ VOLUME /root/.MazesOfMonad
47
+ ENTRYPOINT ["/root/.cabal/bin/mazesofmonad"]
48
+
49
+ Develop and ship your Haskell application with a Dockerfile that utilizes the
50
+ build cache for quick iteration.
51
+
52
+ FROM haskell:7.8
53
+
54
+ RUN cabal update
55
+
56
+ # Add .cabal file
57
+ ADD ./server/snap-example.cabal /opt/server/snap-example.cabal
58
+
59
+ # Docker will cache this command as a layer, freeing us up to
60
+ # modify source code without re-installing dependencies
61
+ RUN cd /opt/server && cabal install --only-dependencies -j4
62
+
63
+ # Add and Install Application Code
64
+ ADD ./server /opt/server
65
+ RUN cd /opt/server && cabal install
66
+
67
+ # Add installed cabal executables to PATH
68
+ ENV PATH /root/.cabal/bin:$PATH
69
+
70
+ # Default Command for Container
71
+ WORKDIR /opt/server
72
+ CMD ["snap-example"]
73
+
74
+ This example can be reviewed in more depth at
75
+ https://github.com/darinmorrison/docker-haskell/tree/docker-library/examples/7.8.3/snap
0 commit comments