I am new to the DevOps world but I am trying to build a pipeline using Jenkins and Docker.
I have Jenkins building the docker image by:
docker build -f Dockerfile --build-arg jenkins_jar_file=${JENKINS_JAR_FILE} -t ${DOCKER_IMAGE} .
Where JENKINS_JAR_FILE is a variable that points to the jar file produced by Jenkins
This is my Dockerfile:
FROM ~~container_on_private_registry~~
USER root
WORKDIR /root
ARG jenkins_jar_file
RUN mkdir -p /root/app/app.jar
COPY ${jenkins_jar_file} /root/app/app.jar
ENTRYPOINT ["java", "-jar", "/root/app/app.jar"]
However, I feel like the image is not being built with the right JAR? I run docker images and see my image - but it says "Created 4 Days ago" I see the same thing when I run docker images histroy for the entrypoint step.
When I actually try to run the image against a container, it for some odd reason tries to run against a jar which doesn't exist in the image. Instead it returns the following error: /root/app-1.0-20180729.204127-14
Any help appreaciated :)
/root/app/app.jar/app.jar
.