Stack无法找到Haskell可执行文件以复制到docker容器

时间:2018-05-16 14:11:23

标签: docker haskell haskell-stack

当我运行$ stack image container时,我收到以下错误:

Note: 'executables' not specified for a image container, so every executable in the project's local bin dir will be used.

Warning: The project's local bin dir contains no files, so no executables will be added to the docker image.

这是我的cabal文件:

name:                haskell-gae
version:             0.1.0.0
synopsis:            Simple project template from stack
description:         Please see README.md
homepage:            http://github.com/githubuser/haskell-gae#readme
license:             BSD3
license-file:        LICENSE
author:              Author name here
maintainer:          example@example.com
copyright:           2010 Author Here
category:            Web
build-type:          Simple
cabal-version:       >=1.10

executable haskell-gae
  hs-source-dirs:      src
  main-is:             Main.hs
  default-language:    Haskell2010
  build-depends:       base >= 4.7 && < 5,
                       scotty,
                       aeson

这是我的stack.yaml:

resolver: lts-11.9
packages:
- '.'
extra-deps: []
flags: {}
extra-package-dbs: []

docker:
    enable: true

image:
  container:
      base: "fpco/ubuntu-with-libgmp:14.04"
      name: "testimg"

      entrypoints:
        - haskell-gae

$ stack build运行时没有错误

$ stack build --copy bins出现此错误:

Couldn't find executable haskell-gae in directory /home/coder/Nextcloud/Projects/haskell-docker/app/.stack-work/install/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/lts-11.9/8.2.2/bin/

我搜索了haskell-gae可执行文件,发现了这个:

sudo find / -name haskell-gae

/home/coder/Nextcloud/Projects/haskell-docker/app/.stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.0.1.0/build/haskell-gae
/home/coder/Nextcloud/Projects/haskell-docker/app/.stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.0.1.0/build/haskell-gae/haskell-gae

请注意,它检查exe的文件夹位置是不同的。不知道如何解决这个问题并让stack image container生成一个已编译的可执行文件运行的docker镜像。任何帮助将不胜感激。

0 个答案:

没有答案