You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#21: Since the official GraalVM Docker image was removed from DockerHub - and is published to GitHub Packages further on, we need to do the full switch to spring-native 0.8.3, which supports GraalVM 20.3.x and the release versions of Spring 2.4.x. Removed -H:+TraceClassInitialization as of oracle/graal@8c210f7
[](https://spring-boot-graal.herokuapp.com/hello)
9
9
[](https://hub.docker.com/r/jonashackt/spring-boot-graalvm)
10
10
@@ -57,6 +57,7 @@ This project is used as example in some articles:
57
57
*[Work around the Heroku 512MB RAM cap: Building our Dockerimage with TravisCI](#work-around-the-heroku-512mb-ram-cap-building-our-dockerimage-with-travisci)
58
58
*[Tackling 'Error: Image build request failed with exit status 137' with the -J-Xmx parameter](#tackling-error-image-build-request-failed-with-exit-status-137-with-the--j-xmx-parameter)
59
59
*[Pushing and Releasing our Dockerized Native Spring Boot App on Heroku Container Infrastructure](#pushing-and-releasing-our-dockerized-native-spring-boot-app-on-heroku-container-infrastructure)
60
+
*[Pushing and Releasing our Dockerized Native Spring Boot App on Heroku Container Infrastructure using GitHub Actions](#pushing-and-releasing-our-dockerized-native-spring-boot-app-on-heroku-container-infrastructure-using-github-actions)
60
61
*[Autorelease on Docker Hub with TravisCI](#autorelease-on-docker-hub-with-travisci)
61
62
*[Links](#links)
62
63
@@ -1003,14 +1004,14 @@ This one does exactly what we did with TravisCI - building the native image usin
1003
1004
1004
1005
# Use Docker to compile a Spring Boot App with GraalVM
1005
1006
1006
-
There's an [official Docker image from Oracle](https://hub.docker.com/r/oracle/graalvm-ce/tags), but this one sadyl lacks both Maven with it's `mvn` command and the `native-image` plugin also not installed.
1007
+
There's an [official Docker image from Oracle](https://github.com/orgs/graalvm/packages/container/package/graalvm-ce), but this one sadyl lacks both Maven with it's `mvn` command and the `native-image` plugin also not installed.
1007
1008
1008
1009
But we can help ourselves - we just craft a simple [Dockerfile](Dockerfile) for us. We're already used to leverage SDKMAN to install Maven. Therefore we need to install `unzip` and `zip` first, since SDKMAN needs both to work properly:
1009
1010
1010
1011
```dockerfile
1011
1012
# Simple Dockerfile adding Maven and GraalVM Native Image compiler to the standard
When I first thought about a Docker usage, I wanted to pack this build into a `Dockerfile` also - but then I realized, that there's [no easy way of using Docker volumes at Docker build time](https://stackoverflow.com/questions/51086724/docker-build-using-volumes-at-build-time). But I really wanted to mount a Docker volume to my local Maven repository like `--volume "$HOME"/.m2:/root/.m2` to prevent the download of all the Spring Maven dependencies over and over again every time we start our Docker container.
Additionally the second container isn't based on the `oracle/graalvm-ce` image containing a GraalVM installation, Maven and the `native-image` command - but instead uses [the base image of this image](https://github.com/oracle/docker-images/blob/master/GraalVM/CE/Dockerfile.java11), which is `oraclelinux:7-slim`.
1123
+
Additionally the second container isn't based on the `ghcr.io/graalvm/graalvm-ce` image containing a GraalVM installation, Maven and the `native-image` command - but instead uses [the base image of this image](https://github.com/oracle/docker-images/blob/master/GraalVM/CE/Dockerfile.java11), which is `oraclelinux:7-slim`.
1123
1124
1124
1125
With that we reduce the resulting Docker image size from around `1.48GB` to only `186MB`!
1125
1126
@@ -1154,7 +1155,7 @@ user 16m32.096s
1154
1155
sys 1m34.441s
1155
1156
Removing intermediate container 151e1413ec2f
1156
1157
---> be671d4f237f
1157
-
Step 10/13 : FROM oracle/graalvm-ce:20.2.0-java11
1158
+
Step 10/13 : FROM docker pull ghcr.io/graalvm/graalvm-ce:ol7-java11-20.3.1.2
1158
1159
---> 364d0bb387bd
1159
1160
Step 11/13 : MAINTAINER Jonas Hecht
1160
1161
---> Using cache
@@ -1610,7 +1611,7 @@ This pulls the latest `jonashackt/spring-boot-graalvm` image and runs our app lo
1610
1611
1611
1612
# Links
1612
1613
1613
-
### Spring / Pivotal
1614
+
### Spring
1614
1615
1615
1616
Current docs: https://repo.spring.io/milestone/org/springframework/experimental/spring-graalvm-native-docs/0.7.0/spring-graalvm-native-docs-0.7.0.zip!/reference/index.html
Spring Boot 2.4.0 Release + Oracle GraalVM 20.3.x compatibility: https://spring.io/blog/2020/11/23/spring-native-for-graalvm-0-8-3-available-now
1633
+
1634
+
No `-H:+TraceClassInitialization` as simple boolean anymore: https://github.com/quarkusio/quarkus/issues/12434 & https://github.com/oracle/graal/commit/8c210f7fdbba5045bfbe14b6870f98ebbff6eed7
1635
+
1636
+
With GraalVM 20.3.x the official Docker image moved from Docker Hub to GitHub Packages: https://github.com/orgs/graalvm/packages/container/package/graalvm-ce
0 commit comments