fix: Update Dockerfile to use USER 1001 for K8s compatibility
This commit is contained in:
@@ -1,11 +1,20 @@
|
|||||||
FROM registry.access.redhat.com/ubi8/openjdk-17:1.20
|
FROM registry.access.redhat.com/ubi8/openjdk-17:1.20
|
||||||
|
|
||||||
ENV LANGUAGE='en_US:en'
|
ENV LANGUAGE='en_US:en'
|
||||||
COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
|
|
||||||
COPY --chown=185 target/quarkus-app/*.jar /deployments/
|
# Copy files with correct ownership for user 1001
|
||||||
COPY --chown=185 target/quarkus-app/app/ /deployments/app/
|
COPY --chown=1001:1001 target/quarkus-app/lib/ /deployments/lib/
|
||||||
COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
|
COPY --chown=1001:1001 target/quarkus-app/*.jar /deployments/
|
||||||
|
COPY --chown=1001:1001 target/quarkus-app/app/ /deployments/app/
|
||||||
|
COPY --chown=1001:1001 target/quarkus-app/quarkus/ /deployments/quarkus/
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
USER 185
|
|
||||||
|
# Use user 1001 (compatible with K8s securityContext)
|
||||||
|
USER 1001
|
||||||
|
|
||||||
ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
|
ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
|
||||||
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
|
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
|
||||||
ENTRYPOINT ["/opt/jboss/container/java/run/run-java.sh"]
|
|
||||||
|
# Use direct java command instead of run-java.sh to avoid permission issues
|
||||||
|
ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar"]
|
||||||
|
|||||||
Reference in New Issue
Block a user