Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
- uses: fugerit-org/psychic-actions/maven-container-publish@mcp
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
maven-options: -B clean package -P test,buildreact
maven-options: -B clean package -P test,buildreact -Dquarkus.package.jar.aot.enabled=true -DskipITs=false
java-version: '25'
java-distribution: 'graalvm'
docker-context: 'fj-doc-playground-quarkus'
docker-file: './fj-doc-playground-quarkus/Dockerfile'
docker-platforms: linux/amd64,linux/arm64
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- fj-doc-playground-quarkus base image ubi9/openjdk-25-runtime:1.24-2.1774011800
- quarkus-version set to 3.34.2

### Fixed
Expand Down
55 changes: 40 additions & 15 deletions fj-doc-playground-quarkus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,50 @@
# fj-doc-playground-quarkus image build 1.0.0
#
# Public built image form amd64/arm64 linux can be found on repository :
# https://hub.docker.com/repository/docker/fugeritorg/fj-doc-playground-quarkus/general
#
# create : docker run -it -p 8080:8080 --name fj-doc-playground-quarkus fugeritorg/fj-doc-playground-quarkus:latest
# start : docker start fj-doc-playground-quarkus
# stop : docker stop fj-doc-playground-quarkus
#
# Image tag :
# docker image tag [image tag] fugeritorg/fj-doc-playground-quarkus:latest
#
# Change with any base openjdk image is preferred
FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.22-1.1753981256
# ---- Stage 1: Build AOT cache ----
FROM registry.access.redhat.com/ubi9/openjdk-25-runtime:1.24-2.1774011800 AS aot-builder

COPY --chown=185:0 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=185:0 target/quarkus-app/*.jar /deployments/
COPY --chown=185:0 target/quarkus-app/app/ /deployments/app/
COPY --chown=185:0 target/quarkus-app/quarkus/ /deployments/quarkus/

WORKDIR /deployments

USER root

RUN timeout 120 java -XX:AOTCacheOutput=app.aot \
-Xlog:aot*=debug:file=/tmp/aot.log \
-Dquarkus.application.exit-on-startup=true \
-jar quarkus-run.jar > /tmp/app.log 2>&1 || true && \
echo "=== AOT Cache Generation Log ===" && \
tail -50 /tmp/app.log && \
if [ -f /tmp/aot.log ]; then echo "=== AOT Debug Log ===" && tail -50 /tmp/aot.log; fi && \
echo "=== Checking for AOT cache ===" && \
if [ -f /deployments/app.aot ]; then \
echo "✓ AOT cache generated successfully"; \
ls -lh /deployments/app.aot; \
else \
echo "⚠ WARNING: AOT cache file not generated"; \
fi

USER 185:0

# ---- Stage 2: Runtime image ----
FROM registry.access.redhat.com/ubi9/openjdk-25-runtime:1.24-2.1774011800

LABEL org.opencontainers.image.authors="Fugerit" \
org.opencontainers.image.source="Quarkus" \
org.opencontainers.image.revision="1.0.0"


COPY --chown=185:0 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=185:0 target/quarkus-app/*.jar /deployments/
COPY --chown=185:0 target/quarkus-app/app/ /deployments/app/
COPY --chown=185:0 target/quarkus-app/quarkus/ /deployments/quarkus/

# Copia l'AOT cache generata nello stage precedente
COPY --chown=185:0 --from=aot-builder /deployments/app.aot /deployments/app.aot

Comment on lines +43 to +45
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AOT generation step explicitly warns that /deployments/app.aot might not be generated, but the runtime stage unconditionally COPYs that file from aot-builder. If AOT generation fails or times out, the Docker build will fail at this COPY. To make the build resilient, ensure the file always exists (e.g., create an empty placeholder when missing) or adjust the build so the runtime stage doesn’t depend on a conditional artifact.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks for the feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in af47d91. When AOT cache generation fails or times out, the builder stage now runs touch /deployments/app.aot to create an empty placeholder, ensuring the COPY in the runtime stage always succeeds. The existing [ -s app.aot ] check in the CMD already handles the empty-file case by falling back to normal startup.

WORKDIR /deployments

EXPOSE 8080

# Run with AOT cache if available, otherwise normal startup
CMD ["sh", "-c", "cd /deployments && if [ -f app.aot ] && [ -s app.aot ]; then echo 'Starting with AOT cache...'; java -XX:AOTCache=app.aot -jar quarkus-run.jar; else echo 'Starting without AOT cache...'; java -jar quarkus-run.jar; fi"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.fugerit.java.doc.playground;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
class CatalogRestIt extends CatalogRestTest {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.fugerit.java.doc.playground;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
class ConfigConvertRestIt extends ConfigConvertRestTest {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.fugerit.java.doc.playground;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
class ConfigRestIt extends ConvertRestTest {
Comment thread
fugerit79 marked this conversation as resolved.
Outdated

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.fugerit.java.doc.playground;

import io.quarkus.test.junit.QuarkusIntegrationTest;

import static io.restassured.RestAssured.given;

Comment thread
fugerit79 marked this conversation as resolved.
Outdated
@QuarkusIntegrationTest
class GenerateRestIt extends GenerateRestTest {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.fugerit.java.doc.playground;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
class ValRestIt extends ValRestTest {

}
Loading