This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 96f625370 refactor(docker): make Dockerfile OpenShift compatible 
(#8657)
96f625370 is described below

commit 96f625370ce6eb1c2f658646492681c14f59cbfe
Author: BFahy <[email protected]>
AuthorDate: Mon Dec 15 17:35:09 2025 +1000

    refactor(docker): make Dockerfile OpenShift compatible (#8657)
    
    Updates the base image for the API and Config UI builds to run correctly on 
OpenShift. No functional behavior changes intended outside container 
build/runtime.
    
    For issue #8504
---
 backend/Dockerfile   | 5 +++++
 config-ui/Dockerfile | 2 ++
 grafana/Dockerfile   | 4 ++++
 3 files changed, 11 insertions(+)

diff --git a/backend/Dockerfile b/backend/Dockerfile
index c93b30c6a..69cbeca7a 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -173,6 +173,11 @@ COPY --from=build /app/resources /app/resources
 ENV PATH="/app/bin:${PATH}"
 ENV DEBUG="$DEBUG"
 
+USER root
+RUN chgrp -R 0 /app && \
+    chmod -R g=u /app
+USER devlake
+
 #add tini, prevent zombie process
 ENTRYPOINT ["/usr/bin/tini", "--"]
 
diff --git a/config-ui/Dockerfile b/config-ui/Dockerfile
index 25cd6dc2c..7fadb956b 100644
--- a/config-ui/Dockerfile
+++ b/config-ui/Dockerfile
@@ -44,5 +44,7 @@ EXPOSE 4000 4443
 RUN apt update && apt install -y apache2-utils iproute2
 COPY --from=builder /home/node/code/nginx.sh /usr/bin/nginx.sh
 RUN chmod +x /usr/bin/nginx.sh
+RUN chgrp -R 0 /etc/nginx /var/log/nginx /usr/share/nginx /run && \
+    chmod -R g=u /etc/nginx /var/log/nginx /usr/share/nginx /run
 USER 101
 CMD /usr/bin/nginx.sh
diff --git a/grafana/Dockerfile b/grafana/Dockerfile
index 73f9ddae9..406e7c9a0 100644
--- a/grafana/Dockerfile
+++ b/grafana/Dockerfile
@@ -34,4 +34,8 @@ ENV GF_SERVER_SERVE_FROM_SUB_PATH=true
 ENV GF_DASHBOARDS_JSON_ENABLED=true
 ENV GF_LIVE_ALLOWED_ORIGINS='*'
 ENV 
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/etc/grafana/dashboards/Homepage.json
+USER root
 RUN grafana-cli plugins install grafana-piechart-panel
+RUN chgrp -R 0 /etc/grafana /usr/share/grafana /var/lib/grafana && \
+    chmod -R g=u /etc/grafana /usr/share/grafana /var/lib/grafana
+USER 101

Reply via email to