当我尝试运行一个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&
我有遗漏的吗?