-
Notifications
You must be signed in to change notification settings - Fork 7
/
Containerfile
35 lines (26 loc) · 1.22 KB
/
Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM registry.access.redhat.com/ubi8/ubi:8.0
MAINTAINER Red Hat Training <[email protected]>
ENV DOCROOT=/var/www/html
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"
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 yum install -y --nodocs --disableplugin=subscription-manager httpd && \
yum clean all --disableplugin=subscription-manager -y && \
echo "Welcome to Openshift from Parent image" > ${DOCROOT}/index.html
ONBUILD COPY src/ ${DOCROOT}/
# This stuff is needed to ensure a clean start
RUN rm -rf /run/httpd && mkdir /run/httpd
RUN chgrp -R 0 /var/run/httpd /var/log/httpd
RUN chmod -R g=u /var/run/httpd /var/log/httpd
RUN sed -i "s/Listen 80/Listen 8080/g" /etc/httpd/conf/httpd.conf
# Allows child images to inject their own content into DocumentRoot
EXPOSE 8080
# Run as the root user
USER 1001
# Launch httpd
CMD /usr/sbin/httpd -DFOREGROUND