Repository navigation
Conversation
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
| 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 |
There was a problem hiding this comment.
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/*
| 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 |
There was a problem hiding this comment.
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
Summary
Upgrades the two remaining custom runtime
Dockerfiles in the repository off the deprecated, End-of-Lifegcr.io/google_appengine/php72(Ubuntu 16.04) andgcr.io/google_appengine/php(Debian Jessie) base images tophp:8.3-apache(CVE-2026-109618 & CVE-2026-109619):cloud_sql/sqlserver/pdo/Dockerfile&README.md: Migrate fromgcr.io/google_appengine/php72(Ubuntu 16.04 //opt/php72) tophp:8.3-apache(Debian 12 /msodbcsql18/docker-php-ext-enable pdo_sqlsrv).endpoints/getting-started/Dockerfile.custom: Migrate fromgcr.io/google_appengine/php(Debian Jessie) tophp:8.3-apache.