gpt4 book ai didi

ubuntu - 错误 : Unable to access jarfile when running docker container

转载 作者:太空宇宙 更新时间:2023-11-03 16:56:44 41 4
gpt4 key购买 nike

尝试运行 docker 容器时出现以下错误:

Error: Unable to access jarfile

我的 Dockerfile 是这样的:

FROM ubuntu:16.04

# Install Updates
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y software-properties-common && \
apt-add-repository -y ppa:openjdk-r/ppa && \
apt-get update -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/*

# Install Packages
RUN apt-get -qq update -y && \
apt-get -q install -y \
wget \
openssh-server \
openjdk-8-jdk \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/*

# Add the config files
ADD /apps/ /home/smartling/

# Adding the jar application
ADD /apps/flagship/repo-connector-1.5.4/repo-connector-1.5.4.jar /home/smartling/flagship/repo-connector-1.5.4/

# Making sure the files are there
RUN ls -la /home/smartling/flagship/repo-connector-1.5.4/

# Start the jar file when container launches
CMD ["java","-jar","/home/smartling/flagship/repo-connector-1.5.4/repo-connector-1.5.4.jar -start&"]

然后我构建

docker build -t smartlingflagship .

一切顺利

我运行容器

docker run --rm --name smartlingconn smartlingflagship

返回时出现以下错误:

Error: Unable to access jarfile /home/smartling/flagship/repo-connector-1.5.4/repo-connector-1.5.4.jar -start&

我错过了什么吗?

最佳答案

我可以通过将其添加到底部 ENTRYPOINT ["java","-jar","re​​po-connector-1.5.4.jar"] 来解决这个问题
CMD ["-开始"]

关于ubuntu - 错误 : Unable to access jarfile when running docker container,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49184985/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com