initial commit with apps from course repo
This commit is contained in:
25
s2i-build/.s2i/bin/assemble
Executable file
25
s2i-build/.s2i/bin/assemble
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# S2I assemble script for the 's2i-do288-httpd' image.
|
||||
# The 'assemble' script builds your application source so that it is ready to run.
|
||||
#
|
||||
# For more information refer to the documentation:
|
||||
# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md
|
||||
#
|
||||
|
||||
if [[ "$1" == "-h" ]]; then
|
||||
# If the 's2i-do288-httpd' assemble script is executed with '-h' flag,
|
||||
# print the usage.
|
||||
exec /usr/libexec/s2i/usage
|
||||
fi
|
||||
|
||||
# Restore artifacts from the previous build (if they exist).
|
||||
#
|
||||
if [ "$(ls /tmp/artifacts/ 2>/dev/null)" ]; then
|
||||
echo "---> Restoring build artifacts..."
|
||||
mv /tmp/artifacts/. ./
|
||||
fi
|
||||
|
||||
echo "---> Copying source files to web server directory..."
|
||||
cp -Rf /tmp/src/. /var/www/html/
|
||||
|
||||
10
s2i-build/.s2i/bin/run
Executable file
10
s2i-build/.s2i/bin/run
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# S2I run script for the 's2i-do288-httpd' image.
|
||||
# The run script executes the server that runs your application.
|
||||
#
|
||||
# For more information see the documentation:
|
||||
# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md
|
||||
#
|
||||
|
||||
exec /usr/sbin/httpd -D FOREGROUND
|
||||
12
s2i-build/.s2i/bin/usage
Executable file
12
s2i-build/.s2i/bin/usage
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash -e
|
||||
cat <<EOF
|
||||
This is the s2i-do288-httpd S2I image:
|
||||
To use it, install S2I: https://github.com/openshift/source-to-image
|
||||
|
||||
Sample invocation:
|
||||
|
||||
s2i build git://<source code> s2i-do288-httpd <application image>
|
||||
|
||||
You can then run the resulting image via:
|
||||
docker run <application image>
|
||||
EOF
|
||||
43
s2i-build/Dockerfile
Normal file
43
s2i-build/Dockerfile
Normal file
@@ -0,0 +1,43 @@
|
||||
FROM registry.access.redhat.com/rhel7:7.6
|
||||
|
||||
MAINTAINER Red Hat Training <training@redhat.com>
|
||||
|
||||
# Generic labels
|
||||
LABEL Component="httpd" \
|
||||
Name="s2i-do288-httpd" \
|
||||
Version="1.0" \
|
||||
Release="1"
|
||||
|
||||
# Labels consumed by OpenShift
|
||||
LABEL io.k8s.description="A basic Apache HTTP Server S2I builder image" \
|
||||
io.k8s.display-name="Apache HTTP Server S2I builder image for DO288" \
|
||||
io.openshift.expose-services="8080:http" \
|
||||
io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
|
||||
io.openshift.tags="apache, httpd, do288, s2i"
|
||||
|
||||
# Apache HTTP Server DocRoot
|
||||
ENV DOCROOT /var/www/html
|
||||
|
||||
RUN rpm --rebuilddb && \
|
||||
yum install -y --setopt=tsflags=nodocs --noplugins httpd && \
|
||||
yum clean all --noplugins -y && \
|
||||
echo "This is the default index page from the s2i-do288-httpd S2I builder image." > ${DOCROOT}/index.html
|
||||
|
||||
# Change web server port to 8080
|
||||
RUN sed -i "s/Listen 80/Listen 8080/g" /etc/httpd/conf/httpd.conf
|
||||
|
||||
# Copy the S2I scripts to the default location indicated by the io.openshift.s2i.scripts-url LABEL (default is /usr/libexec/s2i)
|
||||
COPY ./.s2i/bin/ /usr/libexec/s2i
|
||||
|
||||
ENV APP_DIRS /var/www/ /run/httpd/ /etc/httpd/logs/ /var/log/httpd/
|
||||
|
||||
RUN chown -R 1001:1001 $APP_DIRS && \
|
||||
chgrp -R 0 $APP_DIRS && \
|
||||
chmod -R g=u $APP_DIRS
|
||||
|
||||
# This default user is created in the rhel7 image
|
||||
USER 1001
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["usage"]
|
||||
54
s2i-build/training.repo
Normal file
54
s2i-build/training.repo
Normal file
@@ -0,0 +1,54 @@
|
||||
[rhel-7-dvd]
|
||||
baseurl = http://content.example.com/rhel7.6/x86_64/dvd
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHEL DVD
|
||||
|
||||
[rhel-server-rhscl-7-rpms]
|
||||
baseurl = http://content.example.com/ocp4.0/x86_64/rhelrhscl
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHSCL
|
||||
|
||||
[rhel-7-server-datapath-rpms]
|
||||
baseurl = http://content.example.com/ocp4.0/x86_64/rheladditional/rhel-7-fast-datapath-rpms
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHEL 7.6 Datapath Packages
|
||||
|
||||
[rhel-7-server-ansible-26]
|
||||
baseurl = http://content.example.com/ocp4.0/x86_64/rheladditional/rhel-7-server-ansible-2.6-rpms
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHEL 7.6 Ansible Packages
|
||||
|
||||
[rhel-7-server-extras-rpms]
|
||||
baseurl = http://content.example.com/ocp4.0/x86_64/rheladditional/rhel-7-server-extras-rpms
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHEL 7.6 Extra Packages
|
||||
|
||||
[rhel-7-server-common-rpms]
|
||||
baseurl = http://content.example.com/ocp4.0/x86_64/rheladditional/rhel-7-server-rh-common-rpms
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHEL 7.6 Common Packages
|
||||
|
||||
[rhel-7-server-supplementary]
|
||||
baseurl = http://content.example.com/ocp4.0/x86_64/rhelsupplementary
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHEL 7.6 Supplementary Packages
|
||||
|
||||
[rhel-7-server-optional-rpms]
|
||||
baseurl = http://content.example.com/ocp4.0/x86_64/rhelopt
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHEL 7.6 Optional Packages
|
||||
|
||||
[rhel-7-server-updates]
|
||||
baseurl = http://content.example.com/ocp4.0/x86_64/rhelupdates
|
||||
enabled = true
|
||||
gpgcheck = false
|
||||
name = Remote classroom copy of RHEL 7.6 Updates
|
||||
|
||||
Reference in New Issue
Block a user