Category : jar

My goal is to setup a multi-stage docker image build, using layered jars. For that I’m using the following Dockerfile: FROM maven:3.6-openjdk-16-slim AS builder WORKDIR application COPY pom.xml ./ # store maven dependencies so next build doesn’t have to download them again RUN mvn dependency:go-offline COPY src src RUN mvn package # LAYERED JAR ARG ..

Read more

I switched from distroless/java:8 to distroless/java:8-debug container and, when deployed to kubernetes, I started getting following error: Error: Unable to access jarfile /MyApp-0.1.jar This is my Dockerfile: FROM gcr.io/distroless/java:8-debug LABEL CONTAINER_NAME=my-api ARG JAR_FILE=MyApp/core/build/libs/core-0.1-boot.jar COPY ${JAR_FILE} MyApp-0.1.jar ENTRYPOINT ["java","-jar","/MyApp-0.1.jar"] While I was using regular distroless (everything else was the same) I didn’t have this problem. What ..

Read more

Am deploying my ktor application to docker but am experiencing problems.The application runs fine when i run the server locally but when i deploy it to docker the .jar file brings up the following errors Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97) at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Static.call(CallerImpl.kt:106) at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:108) ..

Read more

Some strange error has hit, this code was working earlier. My tree: LM0002254:SellerService$ ls -lrt total 61512 drwxr-xr-x 3 tarun 826136866 96 Feb 8 14:16 gradle -rw-r–r– 1 tarun 826136866 168 Apr 23 13:26 gradle.properties -rwxr-xr-x 1 tarun 826136866 5766 Apr 23 13:26 gradlew -rw-r–r– 1 tarun 826136866 2763 Apr 23 13:26 gradlew.bat -rw-r–r– 1 ..

Read more

I am trying to create a Dockerfile for a service in my application. In order to run the service (without the Dockerfile), I type the following commands: mvn clean package -DskipTests – to build the project java -jar calculatorws-rest/target/calculatorws-rest-0.0.1.jar – to run the service After these commands, the service executes without any error. In order ..

Read more

i have a Dockerfile in which i need to provide build argument before running Dockerfile. ARG JAR_VERSION=${JAR_VERSION} FROM openjdk:8-jre-slim ADD App1-${JAR_VERSION}-SNAPSHOT.jar /opt/myapp/examples/App1-${JAR_VERSION}-SNAPSHOT.jar Not able to figure out why ADD command is not working as required, i have tried multiple ways, but no luck i am supplying build arg on while building image as docker build ..

Read more