website icon indicating copy to clipboard operation
website copied to clipboard

Modernize the Redis work-queue example Dockerfile

Open Mohamed0Mourad opened this issue 4 months ago • 4 comments

Description

The Dockerfile used by the Fine Parallel Processing Using a Work Queue tutorial currently uses the unversioned python base image:

https://github.com/kubernetes/website/blob/main/content/en/examples/application/job/redis/Dockerfile

The current Dockerfile:

  • depends on the mutable, full-size python:latest image
  • retains the pip download cache
  • places application files in the root directory
  • uses two separate COPY instructions
  • uses shell-form CMD

Proposed improvement

I propose to:

  • use a versioned slim Python image, such as python:3.14-slim
  • install Redis using python -m pip install --no-cache-dir redis
  • set /app as the working directory
  • copy both Python files in one instruction
  • use exec-form CMD

The proposed Dockerfile would be:

FROM python:3.14-slim

WORKDIR /app

RUN python -m pip install --no-cache-dir redis

COPY worker.py rediswq.py ./

CMD ["python", "worker.py"]

I am open to using a different supported Python version if the maintainers prefer another versioning policy.

Testing

I plan to verify:

  • the original and updated image sizes
  • a clean Docker build
  • connectivity to a Redis container
  • successful processing of test queue items

I searched the current open issues and pull requests and did not find an overlapping change. I would like to work on this improvement.

/language en /sig apps

Mohamed0Mourad avatar Jul 27 '26 08:07 Mohamed0Mourad

This issue is currently awaiting triage.

SIG Docs takes a lead on issue triage for this website, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

kubernetes-prow[bot] avatar Jul 27 '26 08:07 kubernetes-prow[bot]

/assign

Gourav2580 avatar Jul 27 '26 18:07 Gourav2580

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Oct 25 '26 19:10 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Nov 24 '26 20:11 k8s-triage-robot