103 lines
3.2 KiB
Docker
103 lines
3.2 KiB
Docker
# This image is the base image for all s2i configurable container images.
|
|
FROM registry.fedoraproject.org/fedora:29
|
|
|
|
ENV SUMMARY="Base image with essential libraries and tools used as a base for \
|
|
builder images like perl, python, ruby, etc." \
|
|
DESCRIPTION="The s2i-base image, being built upon s2i-core, provides any \
|
|
images layered on top of it with all the tools needed to use source-to-image \
|
|
functionality. Additionally, s2i-base also contains various libraries needed for \
|
|
it to serve as a base for other builder images, like s2i-python or s2i-ruby." \
|
|
NAME=s2i-base \
|
|
VERSION=1 \
|
|
RELEASE=1 \
|
|
ARCH=x86_64
|
|
|
|
LABEL summary="$SUMMARY" \
|
|
description="$DESCRIPTION" \
|
|
io.k8s.description="$DESCRIPTION" \
|
|
io.k8s.display-name="s2i base" \
|
|
com.redhat.component="$NAME" \
|
|
name="$FGC/$NAME" \
|
|
version="$VERSION" \
|
|
release="$RELEASE.$DISTTAG" \
|
|
architecture="$ARCH" \
|
|
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:$PATH
|
|
|
|
# When bash is started non-interactively, to run a shell script, for example it
|
|
# looks for this variable and source the content of this file. This will enable
|
|
# the SCL for all scripts without need to do 'scl enable'.
|
|
ENV BASH_ENV=${APP_ROOT}/etc/scl_enable \
|
|
ENV=${APP_ROOT}/etc/scl_enable \
|
|
PROMPT_COMMAND=". ${APP_ROOT}/etc/scl_enable"
|
|
|
|
# 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 \
|
|
gettext \
|
|
groff \
|
|
tar \
|
|
unzip" && \
|
|
mkdir -p ${HOME}/.pki/nssdb && \
|
|
chown -R 1001:0 ${HOME}/.pki && \
|
|
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
|
|
rpm -V $INSTALL_PKGS && \
|
|
dnf clean all -y
|
|
|
|
# This is the list of basic dependencies that all language container image can
|
|
# consume.
|
|
RUN INSTALL_PKGS="autoconf \
|
|
automake \
|
|
bzip2 \
|
|
gcc-c++ \
|
|
gd-devel \
|
|
gdb \
|
|
git \
|
|
libcurl-devel \
|
|
libxml2-devel \
|
|
libxslt-devel \
|
|
lsof \
|
|
make \
|
|
mariadb-connector-c-devel \
|
|
npm \
|
|
openssl-devel \
|
|
patch \
|
|
postgresql-devel \
|
|
procps-ng \
|
|
sqlite-devel \
|
|
unzip \
|
|
wget \
|
|
which \
|
|
zlib-devel" && \
|
|
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
|
|
rpm -V $INSTALL_PKGS && \
|
|
dnf clean all -y
|
|
|
|
# Copy extra files to the image.
|
|
COPY ./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}
|