Skip to content

Commit

Permalink
3.x: Do not generate CDS archive when using Dockerfile.jlink (#5158)
Browse files Browse the repository at this point in the history
* Do not generate CDS archive when using Dockerfile.jlink to workaround jvm bug

* Fix copyright
  • Loading branch information
barchetta authored Oct 11, 2022
1 parent 26f6465 commit 19a7cf3
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests
# Don't generate CDS archive to work around JVM bug https://bugs.openjdk.org/browse/JDK-8274944
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests -Djlink.image.addClassDataSharingArchive=false
RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage
Expand Down
5 changes: 3 additions & 2 deletions examples/integrations/neo4j/neo4j-mp/Dockerfile.jlink
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 Oracle and/or its affiliates.
# Copyright (c) 2021, 2022 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,8 @@ RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests
# Don't generate CDS archive to work around JVM bug https://bugs.openjdk.org/browse/JDK-8274944
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests -Djlink.image.addClassDataSharingArchive=false
RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage
Expand Down
5 changes: 3 additions & 2 deletions examples/integrations/neo4j/neo4j-se/Dockerfile.jlink
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 Oracle and/or its affiliates.
# Copyright (c) 2021, 2022 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,8 @@ RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests
# Don't generate CDS archive to work around JVM bug https://bugs.openjdk.org/browse/JDK-8274944
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests -Djlink.image.addClassDataSharingArchive=false
RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage
Expand Down
3 changes: 2 additions & 1 deletion examples/quickstarts/helidon-quickstart-mp/Dockerfile.jlink
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests
# Don't generate CDS archive to work around JVM bug https://bugs.openjdk.org/browse/JDK-8274944
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests -Djlink.image.addClassDataSharingArchive=false
RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage
Expand Down
3 changes: 2 additions & 1 deletion examples/quickstarts/helidon-quickstart-se/Dockerfile.jlink
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests
# Don't generate CDS archive to work around JVM bug https://bugs.openjdk.org/browse/JDK-8274944
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests -Djlink.image.addClassDataSharingArchive=false
RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests
# Don't generate CDS archive to work around JVM bug https://bugs.openjdk.org/browse/JDK-8274944
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests -Djlink.image.addClassDataSharingArchive=false
RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests
# Don't generate CDS archive to work around JVM bug https://bugs.openjdk.org/browse/JDK-8274944
RUN mvn -Ddocker.build=true package -Pjlink-image -DskipTests -Djlink.image.addClassDataSharingArchive=false
RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage
Expand Down

0 comments on commit 19a7cf3

Please sign in to comment.