Skip to content

Commit 785ce83

Browse files
committed
refactor(docker): make Dockerfile OpenShift compatible
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
1 parent 77f8f46 commit 785ce83

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

backend/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ COPY --from=build /app/resources /app/resources
173173
ENV PATH="/app/bin:${PATH}"
174174
ENV DEBUG="$DEBUG"
175175

176+
USER root
177+
RUN chgrp -R 0 /app && \
178+
chmod -R g=u /app
179+
USER devlake
180+
176181
#add tini, prevent zombie process
177182
ENTRYPOINT ["/usr/bin/tini", "--"]
178183

config-ui/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ EXPOSE 4000 4443
4444
RUN apt update && apt install -y apache2-utils iproute2
4545
COPY --from=builder /home/node/code/nginx.sh /usr/bin/nginx.sh
4646
RUN chmod +x /usr/bin/nginx.sh
47+
RUN chgrp -R 0 /etc/nginx /var/log/nginx /usr/share/nginx /run && \
48+
chmod -R g=u /etc/nginx /var/log/nginx /usr/share/nginx /run
4749
USER 101
4850
CMD /usr/bin/nginx.sh

grafana/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ ENV GF_SERVER_SERVE_FROM_SUB_PATH=true
3434
ENV GF_DASHBOARDS_JSON_ENABLED=true
3535
ENV GF_LIVE_ALLOWED_ORIGINS='*'
3636
ENV GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/etc/grafana/dashboards/Homepage.json
37+
USER root
3738
RUN grafana-cli plugins install grafana-piechart-panel
39+
RUN chgrp -R 0 /etc/grafana /usr/share/grafana /var/lib/grafana && \
40+
chmod -R g=u /etc/grafana /usr/share/grafana /var/lib/grafana
41+
USER 101

0 commit comments

Comments
 (0)