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

Support s2i-core building and testing on Fedora 41 #314

Merged
merged 5 commits into from
Sep 24, 2024
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
8 changes: 8 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ jobs:
use_default_tags: 'false'
arch: "amd64, ppc64le, s390x, arm64"

- dockerfile: "Dockerfile.f41"
registry_namespace: "fedora"
tag: "41"
quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME"
quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN"
use_default_tags: 'false'
arch: "amd64, ppc64le, s390x, arm64"

steps:
- name: Build and push s2i-core to quay.io registry
uses: sclorg/build-and-push-action@v4
Expand Down
48 changes: 48 additions & 0 deletions base/Dockerfile.f41
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM quay.io/fedora/s2i-core:41

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 \
ARCH=x86_64

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="s2i base" \
com.redhat.component="$NAME" \
name="fedora/$NAME" \
version="$VERSION" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>"

# 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 \
nodejs-npm \
openssl-devel \
patch \
procps-ng \
sqlite-devel \
unzip \
wget2 \
which \
zlib-ng-compat-devel" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
dnf clean all -y
2 changes: 1 addition & 1 deletion base/Dockerfile.fedora
71 changes: 71 additions & 0 deletions core/Dockerfile.f41
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This image is the base image for all s2i configurable container images.
FROM quay.io/fedora/fedora:41

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=41 \
ARCH=x86_64

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="$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 <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 \
PLATFORM="fedora"

# 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 \
python3 \
rsync \
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

# Copy extra files to the image.
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

# 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}
2 changes: 1 addition & 1 deletion core/Dockerfile.fedora