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

Add support for Testing Redis 7 in CentOS Stream 10 #181

Closed
wants to merge 4 commits into from
Closed
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 @@ -38,6 +38,14 @@ jobs:
quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN"
docker_context: "7"

- dockerfile: "7/Dockerfile.c10s"
registry_namespace: "sclorg"
tag: "c10s"
image_name: "redis-7-c10s"
quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME"
quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN"
docker_context: "10"

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

# Redis image based on Software Collections packages
#
# Volumes:
# * /var/lib/redis/data - Datastore for Redis
# Environment:
# * $REDIS_PASSWORD - Database password

ENV REDIS_VERSION=7 \
HOME=/var/lib/redis

ENV SUMMARY="Redis in-memory data structure store, used as database, cache and message broker" \
DESCRIPTION="Redis $REDIS_VERSION available as container, is an advanced key-value store. \
It is often referred to as a data structure server since keys can contain strings, hashes, lists, \
sets and sorted sets. You can run atomic operations on these types, like appending to a string; \
incrementing the value in a hash; pushing to a list; computing set intersection, union and difference; \
or getting the member with highest ranking in a sorted set. In order to achieve its outstanding \
performance, Redis works with an in-memory dataset. Depending on your use case, you can persist \
it either by dumping the dataset to disk every once in a while, or by appending each command to a log."

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="Redis $REDIS_VERSION" \
io.openshift.expose-services="6379:redis" \
io.openshift.tags="database,redis,redis$REDIS_VERSION,redis-$REDIS_VERSION" \
com.redhat.component="redis-$REDIS_VERSION-container" \
name="sclorg/redis-$REDIS_VERSION-c10s" \
version="$REDIS_VERSION" \
com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
usage="podman run -d --name redis_database -p 6379:6379 quay.io/sclorg/redis-$REDIS_VERSION-c10s" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>"

EXPOSE 6379

# Create user for redis that has known UID
# We need to do this before installing the RPMs which would create user with random UID
# The UID is the one used by the default user from the parent layer (1001),
# and since the user exists already, do not create a new one, but only rename
# the existing
# This image must forever use UID 1001 for redis user so our volumes are
# safe in the future. This should *never* change, the last test is there
# to make sure of that.
RUN getent group redis &> /dev/null || groupadd -r redis &> /dev/null && \
usermod -l redis -aG redis -c 'Redis Server' default &> /dev/null && \
# Install gettext for envsubst command
INSTALL_PKGS="policycoreutils gettext redis" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
dnf -y clean all --enablerepo='*' && \
redis-server --version | grep -qe "^Redis server v=$REDIS_VERSION\." && echo "Found VERSION $REDIS_VERSION" && \
mkdir -p /var/lib/redis/data && chown -R redis.0 /var/lib/redis && \
[[ "$(id redis)" == "uid=1001(redis)"* ]]

# Get prefix path and path to scripts rather than hard-code them in scripts
ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/redis \
REDIS_PREFIX=/usr \
REDIS_CONF=/etc/redis/redis.conf

COPY root /

# this is needed due to issues with squash
# when this directory gets rm'd by the container-setup
# script.
RUN /usr/libexec/container-setup

VOLUME ["/var/lib/redis/data"]

# Using a numeric value because of a comment in [1]:
# If your S2I image does not include a USER declaration with a numeric user,
# your builds will fail by default.
# [1] https://docs.openshift.com/container-platform/4.4/openshift_images/create-images.html#images-create-guide-openshift_create-images
USER 1001

ENTRYPOINT ["container-entrypoint"]
CMD ["run-redis"]
19 changes: 8 additions & 11 deletions 7/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ FROM quay.io/fedora/s2i-core:38
# Environment:
# * $REDIS_PASSWORD - Database password

ENV NAME=redis \
VERSION=7

ENV REDIS_VERSION=$VERSION \
ENV REDIS_VERSION=7 \
HOME=/var/lib/redis

ENV SUMMARY="Redis in-memory data structure store, used as database, cache and message broker" \
Expand All @@ -24,14 +21,14 @@ it either by dumping the dataset to disk every once in a while, or by appending

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$SUMMARY" \
io.k8s.display-name="Redis 7" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="Redis $REDIS_VERSION" \
io.openshift.expose-services="6379:redis" \
io.openshift.tags="database,redis,redis7" \
io.openshift.tags="database,redis,redis$REDIS_VERSION,redis-$REDIS_VERSION" \
com.redhat.component="$NAME" \
name="fedora/$NAME-$VERSION" \
version="$VERSION" \
usage="docker run -d --name redis_database -p 6379:6379 quay.io/fedora/$NAME-$VERSION" \
name="fedora/$NAME-$REDIS_VERSION" \
version="$REDIS_VERSION" \
usage="podman run -d --name redis_database -p 6379:6379 quay.io/fedora/$NAME-$REDIS_VERSION" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>"

EXPOSE 6379
Expand All @@ -51,7 +48,7 @@ RUN getent group redis &> /dev/null || groupadd -r redis &> /dev/null && \
INSTALL_PKGS="redis" && \
dnf install -y --setopt=tsflags=nodocs --nogpgcheck $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
dnf clean all && \
dnf -y clean all --enablerepo='*' && \
redis-server --version | grep -qe "^Redis server v=$REDIS_VERSION\." && echo "Found VERSION $REDIS_VERSION" && \
mkdir -p /var/lib/redis/data && chown -R redis.0 /var/lib/redis && \
[[ "$(id redis)" == "uid=1001(redis)"* ]]
Expand Down
4 changes: 2 additions & 2 deletions 7/root/usr/share/container-scripts/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ See also
Dockerfile and other sources for this container image are available on
https://github.com/sclorg/redis-container.
In that repository you also can find another versions of Python environment Dockerfiles.
Dockerfile for RHEL8 it's `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9`,
for CentOS Stream 9 it's `Dockerfile.c9s` and the Fedora Dockerfile is called Dockerfile.fedora.
Dockerfile for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL9 it's `Dockerfile.rhel9`,
Dockerfile for CentOS Stream 9 it's `Dockerfile.c9s`, Dockerfile for CentOS Stream 10 it's `Dockerfile.c10s` and the Fedora Dockerfile is called Dockerfile.fedora.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Redis container image

Images available on Quay are:
* CentOS Stream 9 [redis-6](https://quay.io/repository/sclorg/redis-6-c9s)
* CentOS Stream 7 [redis-7](https://quay.io/repository/sclorg/redis-7-c9s)
* Fedora [redis-6](https://quay.io/repository/fedora/redis-6)
* Fedora [redis-7](https://quay.io/repository/fedora/redis-7)

Expand All @@ -29,6 +30,7 @@ RHEL versions currently supported are:

CentOS versions currently supported are:
* CentOS Stream 9
* CentOS Stream 10


Installation
Expand Down