From a511778b104c31cd55ef668904950c92676b6040 Mon Sep 17 00:00:00 2001 From: Arko <47105136+arkaprovob@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:55:13 +0530 Subject: [PATCH 1/2] added support for vi and coreutils vim editor will be used for editing files inside the container and coreutils added for ln and other basic utilities --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a72f5d8..ea6dae3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,12 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3-298.1618432845 LABEL name="spaship/httpd" \ summary="Apache Http Server for SPAship" \ description="This a runtime image for SPAship apps" \ - maintainer="Kun Yan " + maintainer="Arkaprovo Bhattacharjee " EXPOSE 8080 -RUN microdnf install -y --nodocs httpd && microdnf clean all +RUN microdnf install -y --nodocs httpd vim-minimal coreutils && microdnf clean all + RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \ && sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf \ From e2df1e74e3f318ac0f379f9a4dcb87e68884b98d Mon Sep 17 00:00:00 2001 From: Arko <47105136+arkaprovob@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:50:40 +0530 Subject: [PATCH 2/2] Refactored Dockerfile to minimize layer count. --- .gitignore | 3 +++ Dockerfile | 21 +++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 5526fd8..40a6ad3 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,6 @@ $RECYCLE.BIN/ *.lnk # End of https://www.gitignore.io/api/vim,linux,macos,windows,visualstudiocode +.idea +local +local-docker-build.bat diff --git a/Dockerfile b/Dockerfile index ea6dae3..8f0609d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3-298.1618432845 +FROM registry.access.redhat.com/ubi9:9.2-755 LABEL name="spaship/httpd" \ summary="Apache Http Server for SPAship" \ @@ -7,21 +7,18 @@ LABEL name="spaship/httpd" \ EXPOSE 8080 -RUN microdnf install -y --nodocs httpd vim-minimal coreutils && microdnf clean all - - -RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \ - && sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf \ - && chgrp -R 0 /var/log/httpd /var/run/httpd \ - && chmod -R g=u /var/log/httpd /var/run/httpd +RUN dnf install -y --nodocs --allowerasing coreutils httpd vim-minimal && \ + dnf clean all && \ + sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf && \ + sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf && \ + chgrp -R 0 /var/log/httpd /var/run/httpd && \ + chmod -R g=u /var/log/httpd /var/run/httpd && \ + ln -sf /dev/stdout /var/log/httpd/access_log && \ + ln -sf /dev/stderr /var/log/httpd/error_log ADD ./httpd.conf /etc/httpd/conf/ ADD ./conf.d/ /etc/httpd/conf.d/ -# forward request and error logs to docker log collector -RUN ln -sf /dev/stdout /var/log/httpd/access_log \ - && ln -sf /dev/stderr /var/log/httpd/error_log - USER 1001 CMD httpd -D FOREGROUND