Skip to content

AbstractRedisContainer .*Ready to accept connections.*\\n Doesn't match custom installation images #10

@ranma2913

Description

@ranma2913

To resolve the redis:7.2-alpine vulnerabilities I've build my own docker image for redis based on ubuntu:noble.
image

FROM ubuntu:noble

# List linux version
RUN cat /etc/issue

USER root

RUN echo "Installing Debian dependencies..." \
  # `apt-get update` caused error `W: GPG error: http://security.debian.org/debian-security stretch/updates InRelease: At least one invalid signature was encountered.` fix: https://github.com/debuerreotype/docker-debian-artifacts/issues/69#issuecomment-603864015
  export DEBIAN_FRONTEND="noninteractive" && \
    # `Error debconf: unable to initialize frontend: Redline` error. Fix: https://github.com/moby/moby/issues/27988#issuecomment-462809153
  echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
  apt-get update && apt-get upgrade -y && \
  apt-get install --no-install-recommends --no-install-suggests -y \
    redis-server

# Create K8s run groups
ARG USER=default-docker
RUN groupadd --gid 2000 runAsGroup \
  && groupadd --gid 3000 fsGroup \
  && useradd --uid 1001 --gid 3000 --system --home /home --shell /bin/bash  -c "Default Dockerfile User" $USER \
  && usermod -a -G runAsGroup $USER

# Add 1001 to the 'redis' group.
RUN usermod -a -G redis $USER

The issue is the startup logs. On the redis:7.2-alpine image the startup logs are:

redis-1  | 1:M 18 Apr 2024 15:32:17.010 * Ready to accept connections tcp

On my custom ubuntu:noble image the startup logs are:

redis-1  | 7:M 18 Apr 2024 15:29:58.187 * Ready to accept connections

You can see the problem in the regex here: AbstractRedisContainer.java#L21 .*Ready to accept connections.*\\n requires 1 or more characters between the work connections and the \n character.

Suggested Solution:

  1. Allow users to configure the readiness check
  2. Change the regex to .*Ready to accept connections(.*)?\\n
  3. Combination of both?

Let me know what you prefer and I can contribute a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions