我编写了 docker 文件来运行 jar 文件,它没有创建日志文件,因为下面的控制台是我的 docker 文件
I write the docker file for run the jar file and it does not create the log file for see the console below is my docker file
From ubuntu
RUN apt-get update &&
apt-get upgrade -y &&
apt-get install -y software-properties-common &&
add-apt-repository ppa:webupd8team/java -y &&
apt-get update &&
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections &&
apt-get install -y oracle-java8-installer &&
apt-get clean
VOLUME /temp
RUN apt-get install -y vim
ADD real_estate_false.jar /real_estate_false.jar
COPY real_estate_false_lib /real_estate_false_lib
COPY resources /resources
COPY testxml /testxml
CMD ["java","-jar","/real_estate_false.jar",">","var/log/jar.log"]
要在 docker 中运行 myapp.jar(例如,避免在主机上安装 java),您可以运行:
To just run myapp.jar in docker (e.g. to avoid installing java on the host) you can just run:
docker run -v `pwd`:/mnt java:8 java -jar /mnt/myapp.jar
这篇关于如何使用 docker 容器中的 docker 文件运行 jar 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何检测 32 位 int 上的整数溢出?How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
return 语句之前的局部变量,这有关系吗?Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
如何将整数转换为整数?How to convert Integer to int?(如何将整数转换为整数?)
如何在给定范围内创建一个随机打乱数字的 intHow do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
java的行为不一致==Inconsistent behavior on java#39;s ==(java的行为不一致==)
为什么 Java 能够将 0xff000000 存储为 int?Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)