I am using XML Configuration method to generate Dockerfile for my project.The generated Dockerfile looks OK and it gets built fine. However when I run it it always fails with the error. We have created an internal base image for java that I'll call as baseImage
Error: Unable to access jarfile echo-0.0.1.jar Description Info
f-m-p version : 3.5.31
Maven version (mvn -v) : Apache Maven 3.3.9
Kubernetes / OpenShift setup and version : N/A
My POM file:
` io.fabric8 fabric8-maven-plugin 3.5.31
<configuration>
<images>
<image>
<name>echo-image:latest</name>
<build>
<entryPoint>
<arg>java</arg>
<arg>-jar</arg>
<arg>/deployments/echo-0.0.1.jar</arg>
</entryPoint>
<from>com/baseimage</from>
<tags>
<tag>latest</tag>
</tags>
<ports>
<port>7000</port>
</ports>
<env>
<JAVA_LIB_DIR>/deployments</JAVA_LIB_DIR>
</env>
<assembly>
<basedir>/deployments</basedir>
<descriptorRef>artifact</descriptorRef>
</assembly>
</build>
</image>
</images>
</configuration>
</plugin>`
Generated Docker File:
FROM com/baseImage
ENV JAVA_LIB_DIR=/deployments
EXPOSE 7000
COPY maven /deployments/
ENTRYPOINT ["java","-jar","/deployments/echo-0.0.1.jar"]
mvn build:
mvn clean package fabric8:build
Docker run output:
Error: Unable to access jarfile /deployments/echo-0.0.1.jar
What am I missing? It is frustrating to not able to get this to work. Please help!