Docker + Yesod链接失败

我正在尝试创build一个Docker化的Yesod应用程序,并且已经初始化了目录./my-app下的Yesod项目。 我的Dockerfile如下所示:

 FROM haskell:7.8 RUN apt-get update && apt-get install -y libpq5 libpq-dev RUN cabal update ADD my-app /opt/my-app WORKDIR /opt/my-app RUN cabal sandbox delete RUN cabal sandbox init RUN cabal install -j --only-dependencies RUN cabal build RUN dist/build/db-import/db-import EXPOSE 3000 CMD ["dist/build/my-app/my-app", "production", "-p", "3000"] 

当我真的去运行docker,它能够build立所有的依赖关系,但我得到一个链接器错误:

 /opt/my-app/.cabal-sandbox/lib/x86_64-linux-ghc-7.8.4/cryptonite-0.3/libHScryptonite-0.3.a(generic.o):(.data+0x0): multiple definition of `gmtab' /opt/my-app/.cabal-sandbox/lib/x86_64-linux-ghc-7.8.4/cipher-aes-0.2.10/libHScipher-aes-0.2.10.a(aes_generic.o):(.data+0x0): first defined here collect2: error: ld returned 1 exit status 

我不完全确定在这里做什么,因为我已经用haskell:latesthaskell:7.10试试这个,但是我仍然以相同的错误结束。 我不确定这是否是特定的容器操作系统是Ubuntu的事实。 我很乐意听取有关此事的build议。

谢谢!

正如@MichaelSnoyman所说,摆弄堆栈并将yesod-static的cabal文件依赖关系更改为== 1.5.0获得了要创build的容器。