簡體   English   中英

構建泊塢窗圖像時堆棧GHCJS項目初始化錯誤

[英]Stack GHCJS project initaliziation error when building a docker image

我正在嘗試創建一個docker鏡像作為GHCJS開發環境。

我在Dockerfile的這一行上得到一個錯誤,即使用堆棧初始化GHCJS模板項目:

RUN stack new helloWorld ghcjs

整個Dockerfile是:

FROM debian:latest

#update
RUN apt-get update
#install apt-utils and emacs
RUN apt-get install -y apt-utils emacs-nox
#install ghcjs dependencies
RUN apt-get install -y curl git libtinfo-dev alex happy nodejs-legacy nodejs
#install stack
RUN curl -sSL https://get.haskellstack.org/ | sh
#add stack to path
RUN echo "PATH=$PATH:/usr/local/bin/stack:/root/.local/bin" >> /root/.profile
#create and change into project directory
RUN mkdir /root/ghcjs/ && cd /root/ghcjs/
#initialize ghcjs project
RUN stack new helloWorld ghcjs
#add stack.yaml
ADD stack.yaml /root/ghcjs/helloWorld/
#install ghcjs
RUN stack setup

輸出和錯誤是:

Downloading template "ghcjs" to create project "helloWorld" in helloWorld/ ...

The following parameters were needed by the template but not provided: author-email, author-name, category, copyright, github-username
You can provide them in /root/.stack/config.yaml, like this:
templates:
  params:
    author-email: value
    author-name: value
    category: value
    copyright: value
    github-username: value
Or you can pass each one as parameters like this:
stack new helloWorld ghcjs -p "author-email:value" -p "author-name:value" -p "category:value" -p "copyright:value" -p "github-username:value"

Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- helloWorld/helloWorld.cabal

Selecting the best among 11 snapshots...

Downloading lts-9.12 build plan ...
Downloaded lts-9.12 build plan.
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpcomplete.com/) ...
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading root
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Updated package list downloaded
Populating index cache ...
Populated index cache.
* Partially matches lts-9.12
    ghcjs-base not found
        - helloWorld requires -any

Downloading nightly-2017-11-09 build plan ...
Downloaded nightly-2017-11-09 build plan.
* Partially matches nightly-2017-11-09
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-8.24 build plan ...
Downloaded lts-8.24 build plan.
* Partially matches lts-8.24
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-7.24 build plan ...
Downloaded lts-7.24 build plan.
* Partially matches lts-7.24
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-6.35 build plan ...
Downloaded lts-6.35 build plan.
* Partially matches lts-6.35
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-5.18 build plan ...
Downloaded lts-5.18 build plan.
* Partially matches lts-5.18
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-4.2 build plan ...
Downloaded lts-4.2 build plan.
* Partially matches lts-4.2
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-3.22 build plan ...
Downloaded lts-3.22 build plan.
* Partially matches lts-3.22
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-2.22 build plan ...
Downloaded lts-2.22 build plan.
* Partially matches lts-2.22
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-1.15 build plan ...
Downloaded lts-1.15 build plan.
* Partially matches lts-1.15
    ghcjs-base not found
        - helloWorld requires -any

Downloading lts-0.7 build plan ...
Downloaded lts-0.7 build plan.
* Partially matches lts-0.7
    ghcjs-base not found
        - helloWorld requires -any

Selected resolver: lts-9.12
Resolver 'lts-9.12' does not have all the packages to match your requirements.
    ghcjs-base not found
        - helloWorld requires -any

This may be resolved by:
    - Using '--solver' to ask cabal-install to generate extra-deps, atop the chosen snapshot.
    - Using '--omit-packages to exclude mismatching package(s).
    - Using '--resolver' to specify a matching snapshot/resolver

The command '/bin/sh -c stack new helloWorld ghcjs' returned a non-zero code: 1

編輯:

這是編輯后的Dockerfile,以獲取@SamuraiJack評論。 它現在已經過了這個問題中提到的問題。

FROM debian:latest

#update
RUN apt-get update
#install apt-utils and emacs
RUN apt-get install -y apt-utils emacs-nox
#install ghcjs dependencies
RUN apt-get install -y curl git libtinfo-dev alex happy nodejs-legacy nodejs
#install stack
RUN curl -sSL https://get.haskellstack.org/ | sh
#add stack to path
RUN echo "PATH=$PATH:/usr/local/bin/stack:/root/.local/bin" >> /root/.profile
#create and change into project directory
RUN mkdir /home/ghcjs/ && cd /home/ghcjs/ && \
#initialize ghc project
stack new helloWorld
#add stack.yaml
ADD stack.yaml /home/ghcjs/helloWorld/
#install ghcjs
RUN cd /home/ghcjs/helloWorld/ && \
stack setup

你需要在用它創建一個新項目之前安裝ghcjs( ghcjs-base將是ghcjs安裝的一部分)。

點擊這里這里

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM