Skip to content

Commit

Permalink
Add java:docker:arm64 script to build m1 compatible image at gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed May 4, 2022
1 parent 8ae3b21 commit f4fc2f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions generators/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ module.exports = class JHipsterServerGenerator extends BaseBlueprintGenerator {
'java:jar': './gradlew bootJar -x test -x integrationTest',
'java:war': './gradlew bootWar -Pwar -x test -x integrationTest',
'java:docker': './gradlew bootJar -Pprod jibDockerBuild',
'java:docker:arm64': 'npm run java:docker -- -PjibArchitecture=arm64',
'backend:unit:test': `./gradlew test integrationTest ${excludeWebapp} ${javaCommonLog} ${javaTestLog}`,
'postci:e2e:package': 'cp build/libs/*.$npm_package_config_packaging e2e.$npm_package_config_packaging',
'backend:build-cache': 'npm run backend:info && npm run backend:nohttp:test && npm run ci:e2e:package',
Expand Down
6 changes: 6 additions & 0 deletions generators/server/templates/gradle/docker.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
jib {
from {
image = "<%= DOCKER_JAVA_JRE %>"
platforms {
platform {
architecture = "${findProperty('jibArchitecture') ?: 'amd64'}"
os = "linux"
}
}
}
to {
image = "<%= baseName.toLowerCase() %>:latest"
Expand Down

0 comments on commit f4fc2f4

Please sign in to comment.