docker image未运行

问题描述 投票:0回答:1

我已经创建了我的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个回答
0
投票

只使用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"]
© www.soinside.com 2019 - 2024. All rights reserved.