我尝试在docker上根据the docs构建yesod
:
# Dockerfile
FROM ubuntu:22.04
RUN apt-get update
RUN apt-get install curl -y
RUN curl -sSL https://get.haskellstack.org/ | sh
RUN stack new my-project yesodweb/sqlite
RUN cd my-project && stack install yesod-bin --install-ghc
RUN cd my-project && stack build
字符串
我得到直到下一个到最后一步,但然后失败:
> docker build --tag host_yesod --file Dockerfile .
=> [1/7] FROM docker.io/library/ubuntu:22.04@sha256:6042500cf4b44b 0.0s
=> CACHED [2/7] RUN apt-get update 0.0s
=> CACHED [3/7] RUN apt-get install curl -y 0.0s
=> CACHED [4/7] RUN curl -sSL https://get.haskellstack.org/ | sh 0.0s
=> CACHED [5/7] RUN stack new my-project yesodweb/sqlite 0.0s
=> CACHED [6/7] RUN cd my-project && stack install yesod-bin --install-ghc
=> ERROR [7/7] RUN cd my-project && stack build 100.7s
型
下面是错误消息:
100.6 Error: [S-7282]
100.6 Stack failed to execute the build plan.
100.6
100.6 While executing the build plan, Stack encountered the error:
100.6
100.6 [S-7011]
100.6 While building package language-javascript-0.7.1.0 (scroll up to its section to see the
100.6 error) using:
100.6 /root/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_6HauvNHV_3.6.3.0_ghc-9.2.8 --verbose=1 --builddir=.stack-work/dist/x86_64-linux-tinfo6/ghc-9.2.8 build --ghc-options ""
100.6 Process exited with code: ExitFailure 1
型
有什么办法可以解决这个问题吗?
已编辑
- 我在(巨大的)日志中找不到任何相关信息
- 以下是日志消息:google doc
2条答案
按热度按时间093gszye1#
你要找的线是
字符串
谷歌搜索
"docker" hGetContents: invalid argument (invalid byte sequence)
告诉我们,这意味着源代码文件不是UTF-8,并导致this StackOverflow answer。所以尝试将en_US.UTF-8 UTF-8
行附加到Docker镜像中的/etc/locale.gen
文件。svujldwt2#
这个答案主要是mb21's答案的附录,包含完整的Dockerfile:
字符串
它用this additional answer聚合了提到的引用。