Skip to content
Snippets Groups Projects
Commit 4c6adbad authored by Sören Henning's avatar Sören Henning
Browse files

Upgrade Quarkus version to 2.6

parent 79c1d156
No related branches found
No related tags found
1 merge request!229Upgrade Quarkus version to 2.6
Pipeline #6162 passed
# Theodolite project
# Theodolite
This project uses Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/> .
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/.
## Running the application in dev mode
You can run your application in dev mode using:
You can run your application in dev mode that enables live coding using:
```sh
./gradlew quarkusDev
......@@ -23,8 +23,10 @@ The application can be packaged using:
./gradlew build
```
It produces the `theodolite-0.7.0-SNAPSHOT-runner.jar` file in the `/build` directory. Be aware that it’s not
an _über-jar_ as the dependencies are copied into the `build/lib` directory.
It produces the `quarkus-run.jar` file in the `build/quarkus-app/` directory.
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `build/quarkus-app/lib/` directory.
The application is now runnable using `java -jar build/quarkus-app/quarkus-run.jar`.
If you want to build an _über-jar_, execute the following command:
......@@ -32,12 +34,10 @@ If you want to build an _über-jar_, execute the following command:
./gradlew build -Dquarkus.package.type=uber-jar
```
The application is now runnable using `java -jar build/theodolite-0.7.0-SNAPSHOT-runner.jar`.
The application, packaged as an _über-jar_, is now runnable using `java -jar build/*-runner.jar`.
## Creating a native executable
It is recommended to use the native GraalVM images to create executable jars from Theodolite. For more information please visit the [Native Image guide](https://www.graalvm.org/reference-manual/native-image/).
You can create a native executable using:
```sh
......@@ -55,7 +55,7 @@ You can then execute your native executable with:
If you want to learn more about building native executables, please consult https://quarkus.io/guides/gradle-tooling.
## Build docker images
## Building docker images
For the jvm version use:
......
plugins {
id 'org.jetbrains.kotlin.jvm' version "1.5.31"
id "org.jetbrains.kotlin.plugin.allopen" version "1.5.31"
id 'org.jetbrains.kotlin.jvm' version "1.6.10"
id "org.jetbrains.kotlin.plugin.allopen" version "1.6.10"
id 'io.quarkus'
id "io.gitlab.arturbosch.detekt" version "1.15.0"
id "org.jlleitschuh.gradle.ktlint" version "10.0.0"
}
repositories {
mavenLocal()
mavenCentral()
mavenLocal()
jcenter()
}
......
./gradlew build -x test
docker build -f src/main/docker/Dockerfile.jvm -t quarkus/theodolite-jvm .
docker run -i --rm -p 8080:8080 quarkus/theodolite-jvm
./gradlew build -Dquarkus.package.type=native -x test
docker build -f src/main/docker/Dockerfile.native -t quarkus/theodolite .
docker run -i --rm -p 8080:8080 quarkus/theodolite
#Gradle properties
quarkusPluginVersion=2.5.2.Final
quarkusPlatformArtifactId=quarkus-bom
quarkusPluginId=io.quarkus
quarkusPluginVersion=2.6.3.Final
quarkusPlatformGroupId=io.quarkus.platform
quarkusPlatformVersion=2.5.2.Final
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformVersion=2.6.3.Final
#org.gradle.logging.level=INFO
\ No newline at end of file
......@@ -18,38 +18,24 @@
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/theodolite-jvm
# docker run -i --rm -p 8080:8080 quarkus/theodolite-jvm
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4
FROM registry.access.redhat.com/ubi8/openjdk-11-runtime:1.10
ARG JAVA_PACKAGE=java-11-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
# Install java and the run-java script
# Also set up permissions for user `1001`
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
&& microdnf update \
&& microdnf clean all \
&& mkdir /deployments \
&& chown 1001 /deployments \
&& chmod "g+rwX" /deployments \
&& chown 1001:root /deployments \
&& curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
&& chown 1001 /deployments/run-java.sh \
&& chmod 540 /deployments/run-java.sh \
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
# We make four distinct layers so if there are application changes the library layers can be re-used
COPY --chown=1001 build/quarkus-app/lib/ /deployments/lib/
COPY --chown=1001 build/quarkus-app/*.jar /deployments/
COPY --chown=1001 build/quarkus-app/app/ /deployments/app/
COPY --chown=1001 build/quarkus-app/quarkus/ /deployments/quarkus/
COPY --chown=185 build/quarkus-app/lib/ /deployments/lib/
COPY --chown=185 build/quarkus-app/*.jar /deployments/
COPY --chown=185 build/quarkus-app/app/ /deployments/app/
COPY --chown=185 build/quarkus-app/quarkus/ /deployments/quarkus/
EXPOSE 8080
USER 1001
USER 185
ENTRYPOINT [ "/deployments/run-java.sh" ]
ENTRYPOINT [ "java", "-jar", "/deployments/quarkus-run.jar" ]
......@@ -18,34 +18,20 @@
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/theodolite-legacy-jar
# docker run -i --rm -p 8080:8080 quarkus/theodolite-legacy-jar
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4
FROM registry.access.redhat.com/ubi8/openjdk-11-runtime:1.10
ARG JAVA_PACKAGE=java-11-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
# Install java and the run-java script
# Also set up permissions for user `1001`
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
&& microdnf update \
&& microdnf clean all \
&& mkdir /deployments \
&& chown 1001 /deployments \
&& chmod "g+rwX" /deployments \
&& chown 1001:root /deployments \
&& curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
&& chown 1001 /deployments/run-java.sh \
&& chmod 540 /deployments/run-java.sh \
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
COPY build/lib/* /deployments/lib/
COPY build/*-runner.jar /deployments/app.jar
COPY build/*-runner.jar /deployments/quarkus-run.jar
EXPOSE 8080
USER 1001
USER 185
ENTRYPOINT [ "/deployments/run-java.sh" ]
ENTRYPOINT [ "java", "-jar", "/deployments/quarkus-run.jar" ]
......@@ -14,12 +14,12 @@
# docker run -i --rm -p 8080:8080 quarkus/theodolite
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4
WORKDIR /deployments/
RUN chown 1001 /deployments \
&& chmod "g+rwX" /deployments \
&& chown 1001:root /deployments
COPY --chown=1001:root build/*-runner /deployments/application
FROM quay.io/quarkus/quarkus-micro-image:1.0
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root build/*-runner /work/application
EXPOSE 8080
USER 1001
......
......@@ -15,8 +15,7 @@
#
###
FROM quay.io/quarkus/quarkus-distroless-image:1.0
WORKDIR /deployments/
COPY build/*-runner /deployments/application
COPY build/*-runner /application
EXPOSE 8080
USER nonroot
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment