为什么Yesod从独有的Stackage快照安装失败?

时间:2014-09-08 07:20:32

标签: haskell docker yesod

我正在努力学习Yesod,但无法开始,因为我似乎无法安装它。为了确保我自己的系统(Mac,Haskell平台)不会影响它,我正在尝试构建一个Docker图像来播放。这是我的Dockerfile,即使你什么都不知道关于Docker,看看我在做什么应该很简单:

FROM ubuntu:14.04

ENV HOME /root
ENV PATH /root/.cabal/bin:$PATH

RUN apt-get update && \
  apt-get install -y ghc ghc-haddock zlib1g-dev curl && \
  cd /tmp && \
  curl http://hackage.haskell.org/package/cabal-install-1.20.0.3/cabal-install-1.20.0.3.tar.gz | tar xzf - && \
  cd cabal-install-1.20.0.3 && \
  sh ./bootstrap.sh && \
  cabal update && \
  sed -i "s%^remote-repo: .*%remote-repo: stackage:http://www.stackage.org/stackage/46bb2d7487546939e22612e7d757f1df5a5163e9%" /root/.cabal/config && \
  cabal update
RUN cabal install alex happy yesod-bin

总而言之,我需要一个准系统Ubuntu,安装ghc,haddock,zlib头文件和curl,只需从源代码下载并安装cabal-install,然后我就这样做,然后根据Stackage说明,使用Stackage快照替换Cabal配置中的现有remote-repo行。

一切似乎都达到了这一点,但是无法安装yesod-bin:

root@35bacb9e52e1:~# cabal install yesod-bin
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: yesod-bin-1.2.12.4 (user goal)
trying: streaming-commons-0.1.4.2 (dependency of yesod-bin-1.2.12.4)
trying: unix-2.6.0.1/installed-f12... (dependency of
streaming-commons-0.1.4.2)
trying: yaml-0.8.9 (dependency of yesod-bin-1.2.12.4)
next goal: aeson (dependency of yaml-0.8.9)
rejecting: aeson-0.8.0.0 (conflict: unix =>
bytestring==0.10.0.2/installed-4f9..., aeson => bytestring>=0.10.4.0)
Dependency tree exhaustively searched.

我知道那里存在冲突,但我不明白如何解决它。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:2)

Sheesh,没关系,Ubuntu的GHC是7.6.x,所以它可能是:(