|
1 | | -## Dockerfile for gitit |
| 1 | +# |
| 2 | +# Dockerfile |
| 3 | +# |
2 | 4 |
|
3 | | -# Use debian 9 (stretch) for gitit 0.12 |
4 | | -FROM debian:9 |
| 5 | +FROM debian:8 |
5 | 6 | LABEL maintainer= "Yang Zhang <[email protected]>" |
6 | 7 |
|
7 | | -# Add gitit packages |
8 | 8 | ENV DEBIAN_FRONTEND noninteractive |
9 | | -RUN apt-get update && apt-get install -y \ |
10 | | - locales git pandoc pandoc-data gitit libghc-filestore-data \ |
11 | | - supervisor gosu |
| 9 | +# Install basic tools which will not be removed |
| 10 | +# The following command installs custom ghc and use cabal to install gitit |
| 11 | +# into system path. The building tools and intermediate haskell libraries are |
| 12 | +# then removed to keep the image slim. The custom ghc installation is copied |
| 13 | +# from library/haskell. We do not inherite from library/haskell because the |
| 14 | +# final image would become very large (2.4G). |
| 15 | +ENV ORIG_PATH $PATH |
| 16 | +ENV PATH /opt/cabal/1.24/bin:/opt/ghc/8.0.2/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:$PATH |
| 17 | +ENV LANG C |
| 18 | +RUN apt-get update && \ |
| 19 | + apt-get install -y --no-install-recommends apt-utils && \ |
| 20 | + echo 'deb http://ftp.debian.org/debian jessie-backports main' \ |
| 21 | + >/etc/apt/sources.list.d/backports.list && \ |
| 22 | + echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main' \ |
| 23 | + >/etc/apt/sources.list.d/ghc.list && \ |
| 24 | + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 && \ |
| 25 | + apt-get update && \ |
| 26 | + apt-get install -y --no-install-recommends \ |
| 27 | + git locales supervisor gosu \ |
| 28 | + cabal-install-1.24 ghc-8.0.2 happy-1.19.5 alex-3.1.7 \ |
| 29 | + zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \ |
| 30 | + ca-certificates g++ && \ |
| 31 | + cabal update && cabal install --prefix=/usr/local gitit && \ |
| 32 | + cabal install --reinstall --prefix=/usr/local --ghc-options="-rtsopts" \ |
| 33 | + gitit && \ |
| 34 | + apt-get purge -y --auto-remove \ |
| 35 | + cabal-install-1.24 ghc-8.0.2 happy-1.19.5 alex-3.1.7 \ |
| 36 | + zlib1g-dev libtinfo-dev libsqlite3-dev ca-certificates g++ && \ |
| 37 | + rm -rf /root/.cabal /root/.stack /root/.ghc && \ |
| 38 | + rm -rf /var/lib/apt/lists/* && \ |
| 39 | + rm -rf /usr/local/bin/*.md /usr/local/bin/doc && \ |
| 40 | + rm -rf /usr/local/bin/pandoc /usr/local/bin/yaml2json \ |
| 41 | + /usr/local/bin/json2yaml && \ |
| 42 | + rm -rf /usr/local/lib/x86_64-linux-ghc-8.0.2 |
| 43 | +ENV PATH /usr/local/bin:$ORIG_PATH |
12 | 44 |
|
13 | 45 | # Use an UTF-8 locale |
14 | 46 | RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ |
|
0 commit comments