I’m creating an docker image file for the jar file that I have to further use it in the Kubernetes cluster.
The image builds up but when I run this image as container, it fails with error
Error: Unable to access jarfile <–filename>
If I run the same image with -it option it runs as a container and the file is present in the filesystem of the container, but I doubt it this really a solution
docker run --name adaptercont1 -it adapterjar:1.0 /bin/bash
Dockerfile
FROM openjdk:25-jdk-slim
RUN mkdir /usr/src/adapterpod
WORKDIR /adapterpod
COPY myjarfile-24.01.00.003.jar /usr/src/adapterpod/
CMD ["java", "-jar", "/usr/src/adapterpod/myjarfile-24.01.00.003.jar -m localhost -Port 3000 -Key myKey -podTenant Java -podName MyPOD"]