【问题标题】:docker image is not running泊坞窗图像未运行
【发布时间】:2019-09-19 03:17:18
【问题描述】:

我已经为我的 sbt 项目创建了一个自定义镜像,这里是 docker 文件

FROM hseeberger/scala-sbt:11.0.2_2.12.8_1.2.8

MAINTAINER name <email>


RUN echo "==> fetch all sbt jars from Maven repo..."       && \
    echo "==> [CAUTION] this may take several minutes!!!"  && \
    sbt publishLocal


WORKDIR /test-commons


# Define default command.
ENTRYPOINT ["sbt publishLocal"]
CMD ["sbt publishLocal"]

然后我建立它

docker build .

docker ps返回

REPOSITORY                     TAG                   IMAGE ID            CREATED             SIZE
test-commons              v1                    8adba9557f57        12 minutes ago      1.05GB

docker run test-commons:v1 给了

docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"sbt publishLocal\": executable file not found in $PATH": unknown.
ERRO[0007] error waiting for container: context canceled 

我是这方面的初学者,请指导我在这里缺少什么

【问题讨论】:

    标签: docker sbt sbt1.0


    【解决方案1】:

    仅使用 CMD 就足够了,删除多余的 ENTRYPOINT 语句并尝试 -

    FROM hseeberger/scala-sbt:11.0.2_2.12.8_1.2.8
    
    MAINTAINER name <email>
    
    
    RUN echo "==> fetch all sbt jars from Maven repo..."       && \
        echo "==> [CAUTION] this may take several minutes!!!"  && \
        sbt publishLocal
    
    
    WORKDIR /test-commons
    
    
    CMD ["sbt", "publishLocal"]
    

    【讨论】:

    • @swaheed - sbt 可执行文件在哪里?分享绝对路径。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-11
    • 2019-01-15
    • 1970-01-01
    • 1970-01-01
    • 2021-04-29
    • 2018-12-15
    • 1970-01-01
    相关资源
    最近更新 更多