Christian H.
05/05/2023, 7:54 AMFAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':kotlinNpmInstall'.
> A problem occurred starting process 'command '/home/gradle/.gradle/nodejs/node-v18.12.1-linux-x64/bin/node''
gradle build --stacktrace:
Caused by: java.io.IOException: Cannot run program "/home/gradle/.gradle/nodejs/node-v18.12.1-linux-x64/bin/node" (in directory "/usr/app/build/js"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 6 more
Caused by: java.io.IOException: error=2, No such file or directory
... 7 more
This is my current Dockerfile, note that it may be a bit messy because I am experimenting with this and that:
# temp container to build using gradle
FROM gradle:8.1.1-jdk17-alpine AS TEMP_BUILD_IMAGE
ENV APP_HOME=/usr/app/
WORKDIR $APP_HOME
# Load environment variables from a file
COPY proxy.env $APP_HOME
ENV ENV_FILE_PATH=$APP_HOME/proxy.env
RUN source $ENV_FILE_PATH
COPY build.gradle.kts settings.gradle.kts .npmrc .yarnrc gradle.properties.local gradle.properties $APP_HOME
RUN cat gradle.properties.local >> gradle.properties
COPY gradle $APP_HOME/gradle
RUN gradle build --stacktrace || return 0
COPY . .
RUN cat gradle.properties.local >> gradle.properties
RUN gradle clean build
# actual container
FROM amazoncorretto:17.0.7-alpine
ENV ARTIFACT_NAME=app-jvm-1.0-SNAPSHOT.jar
ENV APP_HOME=/usr/app/
WORKDIR $APP_HOME
COPY --from=TEMP_BUILD_IMAGE $APP_HOME/build/libs/$ARTIFACT_NAME .
EXPOSE 8080
ENTRYPOINT exec java -jar ${ARTIFACT_NAME}
ephemient
05/05/2023, 11:18 PMChristian H.
05/08/2023, 11:10 AM