diff --git a/Dockerfile b/Dockerfile index a5bd146..0011618 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # This image is the base image for all s2i configurable container images. -FROM registry.fedoraproject.org/fedora:rawhide +FROM quay.io/fedora/fedora:latest 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." \ NAME=s2i-core \ - VERSION=0 \ + VERSION=34 \ ARCH=x86_64 LABEL summary="$SUMMARY" \ @@ -16,7 +16,7 @@ LABEL summary="$SUMMARY" \ io.openshift.s2i.scripts-url=image:///usr/libexec/s2i \ io.s2i.scripts-url=image:///usr/libexec/s2i \ com.redhat.component="$NAME" \ - name="$FGC/$NAME" \ + name="fedora/$NAME" \ version="$VERSION" \ usage="This image is supposed to be used as a base image for other images that support source-to-image" \ maintainer="SoftwareCollections.org " @@ -52,7 +52,7 @@ RUN INSTALL_PKGS="bsdtar \ dnf clean all -y # Copy extra files to the image. -COPY ./root/ / +COPY ./core/root/ / # Create a platform-python symlink if it does not exist already RUN [ -e /usr/libexec/platform-python ] || ln -s /usr/bin/python3 /usr/libexec/platform-python diff --git a/Dockerfile.c8s b/Dockerfile.c8s new file mode 100644 index 0000000..52e35c8 --- /dev/null +++ b/Dockerfile.c8s @@ -0,0 +1,73 @@ +# 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 " + +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} diff --git a/Dockerfile.c9s b/Dockerfile.c9s new file mode 100644 index 0000000..1d81bf9 --- /dev/null +++ b/Dockerfile.c9s @@ -0,0 +1,73 @@ +# This image is the base image for all s2i configurable container images. +FROM quay.io/centos/centos:stream9 + +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" \ + version="1" \ + maintainer="SoftwareCollections.org " + +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="el9" + +# 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} diff --git a/README.md b/README.md index 14a94b0..22fcdc0 100644 --- a/README.md +++ b/README.md @@ -84,4 +84,5 @@ See also Dockerfile and other sources are available on https://github.com/sclorg/s2i-base-container. In that repository you also can find another variants of S2I Base Dockerfiles. The Dockerfile for CentOS is called Dockerfile, the Dockerfile for RHEL7 is called Dockerfile.rhel7, -the Dockerfile for RHEL8 is called Dockerfile.rhel8 and the Dockerfile for Fedora is Dockerfile.fedora. +the Dockerfile for RHEL8 is called Dockerfile.rhel8, the Dockerfile for CentOS Stream 8 is called Dockerfile.c8s, +the Dockerfile for CentOS Stream 9 is called Dockerfile.c9s and the Dockerfile for Fedora is Dockerfile.fedora. diff --git a/root/usr/bin/base-usage b/root/usr/bin/base-usage index 154ccc4..182c49f 100755 --- a/root/usr/bin/base-usage +++ b/root/usr/bin/base-usage @@ -1,7 +1,7 @@ #!/bin/sh -e cat <