Skip to content

Instantly share code, notes, and snippets.

@ret
Forked from creichert/Dockerfile
Created July 26, 2018 21:29
Show Gist options
  • Save ret/ca2168651de9dee548f6cfdff619f0b3 to your computer and use it in GitHub Desktop.
Save ret/ca2168651de9dee548f6cfdff619f0b3 to your computer and use it in GitHub Desktop.
ghcjs-8.4 with stack.
#!/bin/bash
docker build -t tmp-ghcjs .
echo "Copying ghcjs.tar.gz file from the docker image."
docker run --rm tmp-ghcjs cat /opt/ghcjs.tar.gz > ghcjs.tar.gz
FROM ubuntu:16.04
## ensure locale is set during build
ENV LANG C.UTF-8
## Haskell environment
RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main' > \
/etc/apt/sources.list.d/ghc.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 && \
apt-get update && \
apt-get install -y --no-install-recommends \
cabal-install-2.2 \
ghc-8.4.2 \
happy-1.19.5 \
alex-3.1.7 \
zlib1g-dev \
libtinfo-dev \
libsqlite3-0 \
libsqlite3-dev \
ca-certificates \
build-essential \
libgmp-dev \
autoconf \
automake \
curl \
g++ \
python3 \
git
ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/bin:/opt/ghc/8.4.2/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:$PATH
## node.js
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y nodejs
## build GHCJS
WORKDIR /opt
RUN cabal update
RUN git clone https://github.com/alexanderkjeldaas/ghcjs.git && \
cd ghcjs && \
git checkout ghc-8.4 && \
git submodule update --init --recursive
RUN cd ghcjs && ./utils/makePackages.sh -j8
RUN tar cf ghcjs.tar ghcjs && gzip --fast ghcjs.tar
resolver: nightly-2018-05-10
packages:
- location: '.'
compiler: ghcjs-0.2.0.9011009_ghc-8.4.1
setup-info:
ghcjs:
source:
ghcjs-0.2.0.9011009_ghc-8.4.1:
url: /opt/ghcjs.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment