Modernize the Redis work-queue example Dockerfile
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:latestimage - retains the pip download cache
- places application files in the root directory
- uses two separate
COPYinstructions - 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
/appas 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
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.
/assign
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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