Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing, building RHEL10 container-images #323

Merged
merged 4 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ s2i image versions currently provided are:
RHEL versions currently supported are:
* RHEL8
* RHEL9
* RHEL10

CentOS versions currently supported are:
* CentOS Stream 9
Expand Down
52 changes: 52 additions & 0 deletions base/Dockerfile.rhel10
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This image is the base image for all OpenShift v3 language container images.
FROM ubi10/s2i-core

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." \
NODEJS_VER=22 \
NAME=s2i-base

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="s2i base" \
io.openshift.tags="s2i-base rhel10" \
com.redhat.component="s2i-base-container" \
name="ubi10/s2i-base" \
version="1" \
com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI"

# 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 \
libpq-devel \
libxml2-devel \
libxslt-devel \
lsof \
make \
mariadb-connector-c-devel \
openssl-devel \
patch \
procps-ng \
nodejs-npm \
redhat-rpm-config \
sqlite-devel \
unzip \
wget \
which \
zlib-ng-compat-devel" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
node -v | grep -qe "^v$NODEJS_VER\." && echo "Found VERSION $NODEJS_VER" && \
dnf -y clean all --enablerepo='*'
1 change: 1 addition & 0 deletions base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,6 @@ 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 RHEL8 is called Dockerfile.rhel8, the Dockerfile for RHEL9 is called Dockerfile.rhel9,
the Dockerfile for RHEL10 is called Dockerfile.rhel10,
the Dockerfile for CentOS Stream 9 is called Dockerfile.c9s, the Dockerfile for CentOS Stream 10 is called Dockerfile.c10s,
and the Dockerfile for Fedora is Dockerfile.fedora.
68 changes: 68 additions & 0 deletions core/Dockerfile.rhel10
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# This image is the base image for all s2i configurable container images.
FROM ubi10: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=10

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 \
io.openshift.tags="s2i-core rhel10" \
com.redhat.component="s2i-core-container" \
name="ubi10/s2i-core" \
version="1" \
com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI"

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="el10"

# 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 \
glibc-langpack-en \
groff-base \
rsync \
tar \
unzip \
yum" && \
mkdir -p ${HOME}/.pki/nssdb && \
chown -R 1001:0 ${HOME}/.pki && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
dnf -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} -c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT}
1 change: 1 addition & 0 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ 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 RHEL8 is called Dockerfile.rhel8, the Dockerfile for RHEL9 is called Dockerfile.rhel9,
the Dockerfile for RHEL10 is called Dockerfile.rhel10,
the Dockerfile for CentOS Stream 9 is called Dockerfile.c9s, the Dockerfile for CentOS Stream 10 is called Dockerfile.c10s,
and the Dockerfile for Fedora is Dockerfile.fedora.