generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add architecture compatibility flag to native build (#131)
* fix: add architecture compatibility flag to native build * ci: wrong place for the parameter * ci: remove duplication of additional build arg * ci: update to native arch for better compatibility * ci: march compatibility * feat: downgrade java version to 17
- Loading branch information
Ricardo Campos
authored
Nov 7, 2023
1 parent
39f6c8e
commit b1ac0f1
Showing
3 changed files
with
22 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
# Quarkus Images | ||
# https://github.com/quarkusio/quarkus-images | ||
### Builder | ||
FROM ghcr.io/graalvm/native-image:ol8-java17-22 AS build | ||
|
||
# "Provides the native-image executable. Used by the Maven and Gradle plugin from Quarkus to build linux64 executables" | ||
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21 AS build | ||
# Copy | ||
WORKDIR /app | ||
COPY pom.xml mvnw ./ | ||
COPY src ./src | ||
COPY .mvn/ ./.mvn | ||
|
||
# Image defaults to /project; copy controlled by .dockerignore | ||
COPY --chown=quarkus:quarkus . ./ | ||
# Build | ||
RUN ./mvnw package -Pnative -DskipTests | ||
|
||
# "A base image to run Quarkus native application using UBI Micro" | ||
FROM quay.io/quarkus/quarkus-micro-image:2.0 | ||
### Deployer | ||
FROM gcr.io/distroless/java-base:nonroot AS deploy | ||
ARG PORT=8080 | ||
|
||
# Copy | ||
WORKDIR /app | ||
COPY --from=build /app/target/results ./results | ||
|
||
# Port and health check | ||
EXPOSE 8080 | ||
HEALTHCHECK --interval=300s --timeout=3s CMD curl -f http://localhost:8080 | ||
USER 1001 | ||
EXPOSE ${PORT} | ||
HEALTHCHECK CMD curl -f http://localhost:${PORT}/actuator/health | grep '"status":"UP"' | ||
|
||
# Startup | ||
COPY --chown=1001:root --from=build /project/target/results /app | ||
USER 1001 | ||
CMD ["/app", "-Dquarkus.http.host=0.0.0.0"] | ||
ENTRYPOINT ["/app/results"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters