Skip to content

chore: upgrade custom runtime Dockerfiles to PHP 8.3 - #2340

Open
s-deitz wants to merge 1 commit into
mainfrom
fix/priority-1-custom-dockerfiles
Open

s-deitz wants to merge 1 commit into
mainfrom
fix/priority-1-custom-dockerfiles

Conversation

@s-deitz

@s-deitz s-deitz commented Oct 22, 2026

Copy link
Copy Markdown
Member

Summary

Upgrades the two remaining custom runtime Dockerfiles in the repository off the deprecated, End-of-Life gcr.io/google_appengine/php72 (Ubuntu 16.04) and gcr.io/google_appengine/php (Debian Jessie) base images to php:8.3-apache (CVE-2026-109618 & CVE-2026-109619):

  1. cloud_sql/sqlserver/pdo/Dockerfile & README.md: Migrate from gcr.io/google_appengine/php72 (Ubuntu 16.04 / /opt/php72) to php:8.3-apache (Debian 12 / msodbcsql18 / docker-php-ext-enable pdo_sqlsrv).
  2. endpoints/getting-started/Dockerfile.custom: Migrate from gcr.io/google_appengine/php (Debian Jessie) to php:8.3-apache.

@s-deitz
s-deitz requested review from a team as code owners October 22, 2026 19:41
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Oct 22, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Docker configurations to upgrade the PHP runtime from legacy App Engine images to php:8.3-apache for both the Cloud SQL SQL Server PDO sample and the Cloud Endpoints getting started sample. It also updates the SQL Server ODBC driver to version 18 and configures Apache to listen on port 8080. The review feedback suggests optimizing the Docker builds by using composer install instead of composer update to ensure deterministic builds, and using --no-install-recommends along with cleaning up apt lists to minimize the final Docker image sizes.

RUN pecl install pdo_sqlsrv && \
docker-php-ext-enable pdo_sqlsrv
RUN sed -i 's/80/8080/g' /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf
RUN composer update

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using composer update in a Dockerfile is discouraged because it resolves and updates all dependencies to their latest allowed versions during the image build. This makes the build non-deterministic, slow, and potentially prone to breaking if a dependency release contains bugs or breaking changes. It is highly recommended to use composer install (with --no-dev for production-ready environments) to ensure the exact versions from composer.lock are installed consistently.

RUN composer install --no-dev

Comment on lines +8 to +11
RUN apt-get update && \
apt-get -y install gnupg2 curl ca-certificates && \
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg && \
curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list > /etc/apt/sources.list.d/mssql-release.list

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To minimize the Docker image size and follow best practices, it is recommended to use the --no-install-recommends flag with apt-get install and clean up the local package repository cache by removing /var/lib/apt/lists/* in the same RUN instruction.

RUN apt-get update && \\
    apt-get -y install --no-install-recommends gnupg2 curl ca-certificates && \\
    curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg && \\
    curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list > /etc/apt/sources.list.d/mssql-release.list && \\
    rm -rf /var/lib/apt/lists/*

Comment on lines +10 to +12
RUN apt-get update && apt-get -y install unzip && \
composer install --no-dev && \
sed -i 's/80/8080/g' /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To keep the Docker image size small, use --no-install-recommends with apt-get install and clean up the apt cache by removing /var/lib/apt/lists/* in the same RUN instruction.

RUN apt-get update && apt-get -y install --no-install-recommends unzip && \\
    rm -rf /var/lib/apt/lists/* && \\
    composer install --no-dev && \\
    sed -i 's/80/8080/g' /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant