|
|
4438cc3 |
# This image is the base image for all s2i configurable container images.
|
|
|
93f1fe7 |
FROM registry.fedoraproject.org/fedora:rawhide
|
|
|
85f65ff |
|
|
|
4438cc3 |
ENV SUMMARY="Base image which allows using of source-to-image." \
|
|
|
4438cc3 |
DESCRIPTION="The s2i-core image provides any images layered on top of it \
|
|
|
4438cc3 |
with all the tools needed to use source-to-image functionality while keeping \
|
|
|
4438cc3 |
the image size as small as possible." \
|
|
|
4438cc3 |
NAME=s2i-core \
|
|
|
4438cc3 |
VERSION=0 \
|
|
|
4438cc3 |
ARCH=x86_64
|
|
|
85f65ff |
|
|
|
85f65ff |
LABEL summary="$SUMMARY" \
|
|
|
85f65ff |
description="$DESCRIPTION" \
|
|
|
85f65ff |
io.k8s.description="$DESCRIPTION" \
|
|
|
85f65ff |
io.k8s.display-name="s2i core" \
|
|
|
85f65ff |
io.openshift.s2i.scripts-url=image:///usr/libexec/s2i \
|
|
|
85f65ff |
io.s2i.scripts-url=image:///usr/libexec/s2i \
|
|
|
85f65ff |
com.redhat.component="$NAME" \
|
|
|
85f65ff |
name="$FGC/$NAME" \
|
|
|
85f65ff |
version="$VERSION" \
|
|
|
85f65ff |
usage="This image is supposed to be used as a base image for other images that support source-to-image" \
|
|
|
85f65ff |
maintainer="SoftwareCollections.org <sclorg@redhat.com>"
|
|
|
85f65ff |
|
|
|
85f65ff |
ENV \
|
|
|
85f65ff |
# DEPRECATED: Use above LABEL instead, because this will be removed in future versions.
|
|
|
85f65ff |
STI_SCRIPTS_URL=image:///usr/libexec/s2i \
|
|
|
85f65ff |
# Path to be used in other layers to place s2i scripts into
|
|
|
85f65ff |
STI_SCRIPTS_PATH=/usr/libexec/s2i \
|
|
|
85f65ff |
APP_ROOT=/opt/app-root \
|
|
|
85f65ff |
# The $HOME is not set by default, but some applications needs this variable
|
|
|
85f65ff |
HOME=/opt/app-root/src \
|
|
|
31622b3 |
PATH=/opt/app-root/src/bin:/opt/app-root/bin:$PATH \
|
|
|
31622b3 |
PLATFORM="fedora"
|
|
|
85f65ff |
|
|
|
4438cc3 |
# This is the list of basic dependencies that all language container image can
|
|
|
85f65ff |
# consume.
|
|
|
85f65ff |
# Also setup the 'openshift' user that is used for the build execution and for the
|
|
|
85f65ff |
# application runtime execution.
|
|
|
85f65ff |
# TODO: Use better UID and GID values
|
|
|
85f65ff |
RUN INSTALL_PKGS="bsdtar \
|
|
|
85f65ff |
findutils \
|
|
|
85f65ff |
gettext \
|
|
|
c512ee9 |
groff-base \
|
|
|
85f65ff |
tar \
|
|
|
85f65ff |
unzip" && \
|
|
|
85f65ff |
mkdir -p ${HOME}/.pki/nssdb && \
|
|
|
85f65ff |
chown -R 1001:0 ${HOME}/.pki && \
|
|
|
85f65ff |
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
|
|
|
85f65ff |
rpm -V $INSTALL_PKGS && \
|
|
|
85f65ff |
dnf clean all -y
|
|
|
85f65ff |
|
|
|
85f65ff |
# Copy extra files to the image.
|
|
|
85f65ff |
COPY ./root/ /
|
|
|
85f65ff |
|
|
|
31622b3 |
# Create a platform-python symlink if it does not exist already
|
|
|
31622b3 |
RUN [ -e /usr/libexec/platform-python ] || ln -s /usr/libexec/system-python /usr/libexec/platform-python
|
|
|
31622b3 |
|
|
|
85f65ff |
# Directory with the sources is set as the working directory so all STI scripts
|
|
|
85f65ff |
# can execute relative to this path.
|
|
|
85f65ff |
WORKDIR ${HOME}
|
|
|
85f65ff |
|
|
|
85f65ff |
ENTRYPOINT ["container-entrypoint"]
|
|
|
85f65ff |
CMD ["base-usage"]
|
|
|
85f65ff |
|
|
|
85f65ff |
# Reset permissions of modified directories and add default user
|
|
|
85f65ff |
RUN rpm-file-permissions && \
|
|
|
85f65ff |
useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
|
|
|
85f65ff |
-c "Default Application User" default && \
|
|
|
85f65ff |
chown -R 1001:0 ${APP_ROOT}
|