From 79328a5a53d5f3c80276e681a4256a3c4f140739 Mon Sep 17 00:00:00 2001 From: Student User Date: Tue, 26 Sep 2023 04:23:43 -0400 Subject: [PATCH] Changed the Containerfile to enable running as a random uid on OpenShift --- container-build/Containerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/container-build/Containerfile b/container-build/Containerfile index 30d07537b3..43ee458863 100644 --- a/container-build/Containerfile +++ b/container-build/Containerfile @@ -1,2 +1,14 @@ # Use the httpd-parent image as base FROM quay.io/redhattraining/httpd-parent +EXPOSE 8080 +LABEL io.openshift.expose-services="8080:http" +LABEL io.k8s.description="A basic Apache HTTP Server child image, uses ONBUILD" \ +io.k8s.display-name="Apache HTTP Server" \ +io.openshift.expose-services="8080:http" \ +io.openshift.tags="apache, httpd" +RUN sed -i "s/Listen 80/Listen 8080/g" /etc/httpd/conf/httpd.conf \ +RUN sed -i "s/#ServerName www.example.com:80/ServerName 0.0.0.0:8080/g" \ +/etc/httpd/conf/httpd.conf +RUN chgrp -R 0 /var/log/httpd /var/run/httpd && \ +chmod -R g=u /var/log/httpd /var/run/httpd +USER 1001