FROM welder/fedora:latest # workaround for https://github.com/bos/math-functions/issues/52 RUN dnf -y install cabal-install \ https://kojipkgs.fedoraproject.org//packages/ghc-vector-th-unbox/0.2.1.6/1.fc26/x86_64/ghc-vector-th-unbox-0.2.1.6-1.fc26.x86_64.rpm \ https://kojipkgs.fedoraproject.org//packages/ghc-vector-th-unbox/0.2.1.6/1.fc26/x86_64/ghc-vector-th-unbox-devel-0.2.1.6-1.fc26.x86_64.rpm && \ dnf clean all ENV PATH /root/.cabal/bin:$PATH RUN cabal update RUN cabal install happy RUN cabal install hlint RUN mkdir /bdcs # install the build dependencies first so we can cache this layer COPY bdcs.cabal /bdcs/ RUN cd /bdcs/ && cabal update && cabal install --dependencies-only --enable-tests --force-reinstall # copy the rest of the code and build the application COPY cabal.config LICENSE Setup.hs .hlint.yaml /bdcs/ COPY data/ /bdcs/data/ COPY src/ /bdcs/src/ COPY tests/ /bdcs/tests/ WORKDIR /bdcs/ RUN hlint . RUN cabal configure --enable-tests --enable-coverage --prefix=/usr/local RUN cabal build RUN cabal test --show-details=always RUN cabal install --prefix=/usr/local