Skip to content

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

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

Open
ranma2913 opened this issue Apr 18, 2024 · 0 comments

Comments

@ranma2913
Copy link

ranma2913 commented Apr 18, 2024

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.

@ranma2913 ranma2913 changed the title AbstractRedisContainer waitingFor(Wait.forLogMessage(".*Ready to accept connections.*\\n", 1)); Doesn't match custom installation images AbstractRedisContainer .*Ready to accept connections.*\\n Doesn't match custom installation images Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant