如何将Maven工件从关系连接到Docker容器

时间:2019-04-08 16:37:21

标签: maven docker jenkins dockerfile nexus

我正在使用jenkins作为完善工具,使用maven进行构建,使用nexus作为工件存储库以及使用docker来实施CI / CD管道。  所以我的问题是,每当我尝试将“ .jar”文件从nexus部署到docker容器时,都会构建docker映像,但是当我要运行它时,会出现以下错误:

Error: Unable to access jarfile ,junit-1.2.jar

这是我的Dockerfile

FROM ubuntu:16.04
WORKDIR /
RUN apt-get update
RUN apt-get install -y --no-install-recommends software-properties-common
RUN add-apt-repository -y ppa:openjdk-r/ppa
RUN apt-get update
RUN apt-get install -y openjdk-8-jdk
RUN apt-get install -y openjdk-8-jre
RUN update-alternatives --config java
RUN update-alternatives --config javac
RUN apt-get install curl
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV PATH $PATH:$JAVA_HOME/bin
RUN curl -u login:passwd -o junit-1.2.jar "nexus repository URL/junit-1.2.jar" -L

ENTRYPOINT java -jar ,junit-1.2.jar

谢谢您的帮助,我愿意提供任何更好的解决方案。

0 个答案:

没有答案