Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docker Configuration and Base Image #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 10 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3-298.1618432845
FROM registry.access.redhat.com/ubi9:9.2-755
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are no important dependency requirement, I still recommend use the UBI minimal image.

Name Size Uncompressed Size
ubi9 74.5 MB 206.9 MB
ubi9-minimal 36.1 MB 92.9 MB

Less size means less code and less security leak.
I think ubi8-mininal has been verified all features we need are supported.

PS: I have't check if there has any duplicate packages had been installed in ubi base image, but will install again along with httpd installation.

IMO, this is not a big problem, but we should choose the better one for our situation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you talking about this ?
registry.access.redhat.com/ubi9/ubi-minimal:9.2-750.1696515534

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

registry.access.redhat.com/ubi9-minimal:9.2-750.1696515534


LABEL name="spaship/httpd" \
summary="Apache Http Server for SPAship" \
description="This a runtime image for SPAship apps" \
maintainer="Kun Yan <kyan@redhat.com>"
maintainer="Arkaprovo Bhattacharjee <arbhatta@redhat.com>"

EXPOSE 8080

RUN microdnf install -y --nodocs httpd && 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 && \
arkaprovob marked this conversation as resolved.
Show resolved Hide resolved
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