Category : gradle

I am facing a ClassNotFoundException when I try to run my docker image – I just don’t understand why this is happening. When running with docker run –rm -i spring-boot-config-demo:dev this results into Exception in thread "main" java.lang.ClassNotFoundException: com.example.DemoApplication at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:46) at ..

Read more

I am runing the command docker buildx build –push –platform linux/amd64,linux/arm64 -t steinko/gradle-ci-cd . o/gradle-ci-cd . The comand is hanging [+] Building 2108.8s (20/23) => CACHED [linux/amd64 gradleimage 1/5] FROM docker.io/library/[email protected]:9b0871b0061cae621a5f9ca67359da36810e5aeae3a917f4c78ae3cbed6313a5 0.0s => => resolve docker.io/library/[email protected]:9b0871b0061cae621a5f9ca67359da36810e5aeae3a917f4c78ae3cbed6313a5 0.0s => [internal] load build context 0.4s => => transferring context: 17.15MB 0.4s => CACHED [linux/amd64 stage-1 1/3] FROM ..

Read more

I am trying to set up a Docker container that builds and runs a small application. This is my Dockerfile: ##################### # build the jar ##################### FROM gradle:jdk11 as builder COPY –chown=gradle:gradle application /application WORKDIR /application RUN gradle build ##################### # run the app ##################### # Use this on a non-arm machine # FROM openjdk:11 ..

Read more

I need to create a new docker image to use gradle version 2.3. There is no image that is publicly available for use and hence need to customize one. I’m not clear on what values should be given in Dockerfile for this version. My project has multiple project folders, which when built using gradle generates ..

Read more

In my SpringBoot application I have to read a Json file at this path src/main/resources/mock/fileName.json. I done it in this way JsonReader jsonReaderStream = new JsonReader(new InputStreamReader(Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResourceAsStream("./mock/fileName.json")))); It works locally but when I deploy my docker file on Kubernetes and I try to read my Json file I received a FileNotFoundException. I use gradle for ..

Read more

I have a Dockerfile that I build in Bamboo. See below: FROM gradle:6.8.3-jdk8 AS gradleBuild WORKDIR /home/gradle/project COPY –chown=gradle:gradle . /home/gradle/project RUN gradle build –stacktrace FROM openjdk:11-jre COPY –from=gradleBuild /home/gradle/project/build/libs/app.jar ./app.jar #ENTRYPOINT ["java","-jar","/app.jar"] When I build this image using Bamboo, I encounter the error below: standard_init_linux.go:219: exec user process caused: permission denied However, when I ..

Read more