jar文件未显示在Docker容器中

时间:2019-05-07 10:50:15

标签: scala docker sbt

我有一个sbt项目,我正在使用sbt publishLocal命令创建它的Jar,我想要一个docker image来做这样的事情

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

MAINTAINER Sara Waheed <sarawaheed3191@gmail.com>

WORKDIR /myproject

ADD . /myproject

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

我正在构建它docker build -t myproject:v1并运行它docker run myproject:v1 我已经在日志中看到

[info] Main Java API documentation successful.
[info] Packaging /stripe-payment-account/target/myproject-1.0.1-javadoc.jar ...
[info] Done packaging.
[info] :: delivering :: com.test#myproject;1.0.1 :: 1.0.1 :: release :: Tue May 07 10:26:13 UTC 2019
[info]  delivering ivy file to /stripe-payment-account/target/ivy-1.0.1.xml
[info]  published myproject to /root/.ivy2/local/com.test/myproject/1.0.1/poms/myproject.pom
[info]  published myproject to /root/.ivy2/local/com.test/myproject/1.0.1/jars/myproject.jar
[info]  published myproject to /root/.ivy2/local/com.test/myproject/1.0.1/srcs/myproject-sources.jar
[info]  published myproject to /root/.ivy2/local/com.test/myproject/1.0.1/docs/myproject-javadoc.jar
[info]  published ivy to /root/.ivy2/local/com.test/myproject/1.0.1/ivys/ivy.xml
[success] Total time: 77 s, completed May 7, 2019, 10:26:13 AM

当我尝试通过

查找此容器的文件内容时
docker exec -t -i containerid /bin/bash

并查看

cd ///root/.ivy2 

和ls -a仅显示

.  ..  .sbt.ivy.lock  cache

这里缺少本地文件夹,但是当我运行容器时,它表明它在/root/.ivy2/local/com.test/myproject/1.0.1/docs/myproject-javadoc.jar中创建了jar。

为什么它没有显示.ivy2文件夹中的本地文件夹我在这里做错了什么?

0 个答案:

没有答案