Repository navigation
fix(kubernetes_engine): replace deprecated base image in django_tutorial Dockerfile - #14757
Open
TheRealDanii wants to merge 1 commit into
Open
TheRealDanii wants to merge 1 commit into
TheRealDanii wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Dockerfile for the Django tutorial in the Kubernetes Engine directory. It replaces the deprecated Google App Engine Python base image with the official python:3.14-slim image, configures environment variables for unbuffered logging and the default port, optimizes the build process by leveraging layer caching for dependencies, and uses exec to run Gunicorn. There are no review comments to address, and the changes look solid and follow modern Docker best practices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
kubernetes_engine/django_tutorialDockerfile still builds ongcr.io/google_appengine/python, which is no longer maintained and ships Python 3.7 or older.requirements.txtonly installs Django whenpython_version >= "3.12", so in that image Django is never installed and gunicorn fails to loadmysite.wsgi.This replaces it with
python:3.14-slim, the same base image as therun/samples. The container still listens on port 8080 (whichpolls.yamlexpects) and runs the samegunicorn mysite.wsgicommand. The virtualenv is dropped because the official image doesn't need one.How I tested (locally with podman, not on a live GKE cluster):
podman buildsucceedspodman run --rm <img> python -c "import django, gunicorn, psycopg2"works and reports Django 6.1.1podman runwith the default CMD: gunicorn boots and listens on0.0.0.0:8080Checklist
Testing
Compliance & Style
Post-Approval Actions