Skip to content

Commit

Permalink
Add shadowJar plugin to fix Dockerfile build
Browse files Browse the repository at this point in the history
  • Loading branch information
ak-git committed Feb 2, 2025
1 parent 5379685 commit 641e0f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ RUN groupadd -g 1234 customgroup && \
USER customuser

# Copy the app files from host machine to image filesystem
COPY --link hello/build/classes/java/main /home/customuser
COPY --link hello/build/libs/hello-2025.1.0-12-all.jar /home/customuser/hello.jar

# Set the directory for executing future commands
WORKDIR /home/customuser

# Run the Main class
# https://docs.docker.com/reference/build-checks/json-args-recommended/
CMD ["java", "com.ak.app.MainApp"]
ENTRYPOINT ["java", "-jar", "/home/customuser/hello.jar"]
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ spotbugs = '6.1.3'
ben-manes-versions = '0.52.0'
nebula-lint = '20.5.6'
jgitver = '0.10.0-rc03'
johnrengelman-shadow = '8.1.1'

jspecify = '1.0.0'
junit = '5.11.4'
Expand All @@ -22,6 +23,7 @@ spotbugs = { id = 'com.github.spotbugs', version.ref = 'spotbugs' }
ben-manes-versions = { id = 'com.github.ben-manes.versions', version.ref = 'ben-manes-versions' }
nebula-lint = { id = 'nebula.lint', version.ref = 'nebula-lint' }
jgitver = { id = 'fr.brouillard.oss.gradle.jgitver', version.ref = 'jgitver' }
johnrengelman-shadow = { id = 'com.github.johnrengelman.shadow', version.ref = 'johnrengelman-shadow' }

[libraries]
jspecify = { module = 'org.jspecify:jspecify', version.ref = 'jspecify' }
Expand Down
1 change: 1 addition & 0 deletions hello/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java-library'
id 'application'
alias(libs.plugins.johnrengelman.shadow)
alias(libs.plugins.javamodularity.moduleplugin)
}

Expand Down

0 comments on commit 641e0f2

Please sign in to comment.