73 lines
2.6 KiB
Text
73 lines
2.6 KiB
Text
# This image is the base image for all s2i configurable container images.
|
|
FROM quay.io/centos/centos:stream8
|
|
|
|
ENV SUMMARY="Base image which allows using of source-to-image." \
|
|
DESCRIPTION="The s2i-core image provides any images layered on top of it \
|
|
with all the tools needed to use source-to-image functionality while keeping \
|
|
the image size as small as possible."
|
|
|
|
LABEL summary="$SUMMARY" \
|
|
description="$DESCRIPTION" \
|
|
io.k8s.description="$DESCRIPTION" \
|
|
io.k8s.display-name="s2i core" \
|
|
io.openshift.s2i.scripts-url=image:///usr/libexec/s2i \
|
|
io.s2i.scripts-url=image:///usr/libexec/s2i \
|
|
com.redhat.component="s2i-core-container" \
|
|
name="sclorg/s2i-core-c8s" \
|
|
version="1" \
|
|
maintainer="SoftwareCollections.org <sclorg@redhat.com>"
|
|
|
|
ENV \
|
|
# DEPRECATED: Use above LABEL instead, because this will be removed in future versions.
|
|
STI_SCRIPTS_URL=image:///usr/libexec/s2i \
|
|
# Path to be used in other layers to place s2i scripts into
|
|
STI_SCRIPTS_PATH=/usr/libexec/s2i \
|
|
APP_ROOT=/opt/app-root \
|
|
# The $HOME is not set by default, but some applications needs this variable
|
|
HOME=/opt/app-root/src \
|
|
PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
|
PLATFORM="el8"
|
|
|
|
# Copy just prepare-yum-repositories that is needed for packages install step,
|
|
# other files might be added later so changing them does not cause packages
|
|
# to be installed again, which takes long time
|
|
|
|
# This is the list of basic dependencies that all language container image can
|
|
# consume.
|
|
# Also setup the 'openshift' user that is used for the build execution and for the
|
|
# application runtime execution.
|
|
# TODO: Use better UID and GID values
|
|
|
|
RUN INSTALL_PKGS="bsdtar \
|
|
findutils \
|
|
groff-base \
|
|
glibc-locale-source \
|
|
glibc-langpack-en \
|
|
gettext \
|
|
rsync \
|
|
scl-utils \
|
|
tar \
|
|
unzip \
|
|
xz \
|
|
yum" && \
|
|
mkdir -p ${HOME}/.pki/nssdb && \
|
|
chown -R 1001:0 ${HOME}/.pki && \
|
|
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
|
|
rpm -V $INSTALL_PKGS && \
|
|
yum -y clean all --enablerepo='*'
|
|
|
|
# Copy extra files to the image.
|
|
COPY ./core/root/ /
|
|
|
|
# Directory with the sources is set as the working directory so all STI scripts
|
|
# can execute relative to this path.
|
|
WORKDIR ${HOME}
|
|
|
|
ENTRYPOINT ["container-entrypoint"]
|
|
CMD ["base-usage"]
|
|
|
|
# Reset permissions of modified directories and add default user
|
|
RUN rpm-file-permissions && \
|
|
useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
|
|
-c "Default Application User" default && \
|
|
chown -R 1001:0 ${APP_ROOT}
|