diff --git a/images/constants.yml b/images/constants.yml index 5c2899df5d..14b82ac0bc 100644 --- a/images/constants.yml +++ b/images/constants.yml @@ -11,13 +11,11 @@ variables: node18DebianFlavors: bullseye node20DebianFlavors: bullseye,bookworm node22DebianFlavors: bullseye,bookworm - python38DebianFlavors: bullseye,buster python39DebianFlavors: bullseye,buster python310DebianFlavors: bullseye python311DebianFlavors: bullseye,bookworm python312DebianFlavors: bullseye,bookworm python313DebianFlavors: bullseye,bookworm - dotnet60DebianFlavors: bullseye dotnet80DebianFlavors: bullseye,bookworm dotnet90DebianFlavors: bookworm php81DebianFlavors: bullseye @@ -45,16 +43,11 @@ variables: python311_GPG_keys: A035C8C19219BA821ECEA86B64E628F8D684696D python312_GPG_keys: 7169605F62C751356D054A26A821E680E5FA6305 python313_GPG_keys: 7169605F62C751356D054A26A821E680E5FA6305 - python38_GPG_keys: E3FF2839C048B25C084DEBE9B26995E310250568 python39_GPG_keys: E3FF2839C048B25C084DEBE9B26995E310250568 - ASPNET_CORE_APP_60: 6.0.35 - ASPNET_CORE_APP_60_SHA: d86da938338a6d97250436d49340e8f114c05b46512ca562aadca6f3e77403d36468d3f34ed5f2d935c070f9e14aedf7299f5a03d2964dbd6576b9a2d3e776e8 ASPNET_CORE_APP_80: 8.0.15 ASPNET_CORE_APP_80_SHA: 3ca5669d4aff60f1bf8cecb99de05d6b489db150caa7c184d1a8bcdf085c611533e05ad7bd0c5091c726850611cff6b0477ef9b1dbb192ebe9055c03de1cf6d8 ASPNET_CORE_APP_90: 9.0.4 ASPNET_CORE_APP_90_SHA: f3eae8863634a050b90b672b14d466a44c623ca06c6501a3a70efea93e540995e2fa348ae5ef7a3f278110a9ba24043a651150a378e4e5a84c25690b73364132 - NET_CORE_APP_60: 6.0.35 - NET_CORE_APP_60_SHA: d8d10d600fb664336949576f8ec0534dbffd573f754b9e741f20812221fafcac5f509a7e1ab44e9e63fc31a7b5dbcb19e4ec1930ffd29312212dc7454977090e NET_CORE_APP_80: 8.0.15 NET_CORE_APP_80_SHA: 833a848541ba6f71c8792168914856e16de6f71cf0a481c5990f3622b0e3f83123e6024bcabf6b955a7c92e8e904181d40d3bd612595a0d8c47a421267a91ca6 NET_CORE_APP_90: 9.0.4 @@ -70,7 +63,6 @@ variables: php83Version_SHA: f15914e071b5bddaf1475b5f2ba68107e8b8846655f9e89690fb7cd410b0db6c php84Version: 8.4.6 php84Version_SHA: 089b08a5efef02313483325f3bacd8c4fe311cf1e1e56749d5cc7d059e225631 - python38Version: 3.8.20 python39Version: 3.9.22 python310Version: 3.10.17 python311Version: 3.11.12 diff --git a/images/runtime/dotnetcore/6.0/bullseye.Dockerfile b/images/runtime/dotnetcore/6.0/bullseye.Dockerfile deleted file mode 100644 index 9c3333bb23..0000000000 --- a/images/runtime/dotnetcore/6.0/bullseye.Dockerfile +++ /dev/null @@ -1,106 +0,0 @@ -# dotnet tools are currently available as part of SDK so we need to create them in an sdk image -# and copy them to our final runtime image -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS tools-install -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-sos -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-trace -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-dump -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-counters -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-gcdump -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 7.* - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.1-bullseye as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" -RUN chmod +x build.sh && ./build.sh dotnetcore /opt/startupcmdgen/startupcmdgen - - -FROM mcr.microsoft.com/mirror/docker/library/debian:bullseye-slim -ARG BUILD_DIR=/tmp/oryx/build -ADD build ${BUILD_DIR} - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - \ - # .NET Core dependencies - libc6 \ - libgcc1 \ - libgssapi-krb5-2 \ - libicu67 \ - libssl1.1 \ - libstdc++6 \ - zlib1g \ - lldb \ - curl \ - file \ - libgdiplus \ - && apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - -# Configure web servers to bind to port 80 when present -ENV ASPNETCORE_URLS=http://+:80 \ - # Enable detection of running in a container - DOTNET_RUNNING_IN_CONTAINER=true \ - PATH="/opt/dotnetcore-tools:${PATH}" - -COPY --from=tools-install /dotnetcore-tools /opt/dotnetcore-tools - -ARG NET_CORE_APP_60_SHA -ARG ASPNET_CORE_APP_60_SHA -ARG NET_CORE_APP_60 -ARG ASPNET_CORE_APP_60 - -# Install .NET Core -RUN set -ex \ - && curl -SL --output dotnet.tar.gz https://builds.dotnet.microsoft.com/dotnet/Runtime/$NET_CORE_APP_60/dotnet-runtime-$NET_CORE_APP_60-linux-x64.tar.gz \ - && echo "$NET_CORE_APP_60_SHA dotnet.tar.gz" | sha512sum -c - \ - && mkdir -p /usr/share/dotnet \ - && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ - && rm dotnet.tar.gz \ - && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ - && curl -SL --output aspnetcore.tar.gz https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/$ASPNET_CORE_APP_60/aspnetcore-runtime-$ASPNET_CORE_APP_60-linux-x64.tar.gz \ - && echo "$ASPNET_CORE_APP_60_SHA aspnetcore.tar.gz" | sha512sum -c - \ - && mkdir -p /usr/share/dotnet \ - && tar -zxf aspnetcore.tar.gz -C /usr/share/dotnet ./shared/Microsoft.AspNetCore.App \ - && rm aspnetcore.tar.gz \ - && dotnet-sos install \ - && rm -rf ${BUILD_DIR} - -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ARG USER_DOTNET_AI_VERSION -ENV USER_DOTNET_AI_VERSION=${USER_DOTNET_AI_VERSION} -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -ENV DOTNET_VERSION="6.0" -ENV ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS=true -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -COPY DotNetCoreAgent.${USER_DOTNET_AI_VERSION}.zip /DotNetCoreAgent/appinsights.zip -RUN set -e \ - && ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && apt-get update \ - && apt-get install unzip -y \ - && apt-get upgrade --assume-yes \ - && cd DotNetCoreAgent \ - && unzip appinsights.zip && rm appinsights.zip \ No newline at end of file diff --git a/images/runtime/dotnetcore/6.0/buster.Dockerfile b/images/runtime/dotnetcore/6.0/buster.Dockerfile deleted file mode 100644 index 9afb1d214b..0000000000 --- a/images/runtime/dotnetcore/6.0/buster.Dockerfile +++ /dev/null @@ -1,111 +0,0 @@ -# dotnet tools are currently available as part of SDK so we need to create them in an sdk image -# and copy them to our final runtime image -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS tools-install -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-sos -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-trace -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-dump -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-counters -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-gcdump -RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 7.* - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-buster as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" -RUN chmod +x build.sh && ./build.sh dotnetcore /opt/startupcmdgen/startupcmdgen - - -FROM mcr.microsoft.com/mirror/docker/library/debian:buster-slim -ARG BUILD_DIR=/tmp/oryx/build -ADD build ${BUILD_DIR} - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - # .NET Core dependencies - libc6 \ - libgcc1 \ - libgssapi-krb5-2 \ - libicu63 \ - libssl1.1 \ - libstdc++6 \ - zlib1g \ - lldb \ - curl \ - file \ - libgdiplus \ - && apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - -# Configure web servers to bind to port 80 when present -ENV ASPNETCORE_URLS=http://+:80 \ - # Enable detection of running in a container - DOTNET_RUNNING_IN_CONTAINER=true \ - PATH="/opt/dotnetcore-tools:${PATH}" - -COPY --from=tools-install /dotnetcore-tools /opt/dotnetcore-tools - -ARG NET_CORE_APP_60_SHA -ARG ASPNET_CORE_APP_60_SHA -ARG NET_CORE_APP_60 -ARG ASPNET_CORE_APP_60 - -# Install .NET Core -RUN set -ex \ -# based on resolution on https://github.com/NuGet/Announcements/issues/49#issue-795386700 - && apt-get remove ca-certificates -y \ - && apt-get purge ca-certificates -y \ - && apt-get update \ - && apt-get install -f ca-certificates=20200601~deb10u2 -y --no-install-recommends \ - && curl -SL --output dotnet.tar.gz https://builds.dotnet.microsoft.com/dotnet/Runtime/$NET_CORE_APP_60/dotnet-runtime-$NET_CORE_APP_60-linux-x64.tar.gz \ - && echo "$NET_CORE_APP_60_SHA dotnet.tar.gz" | sha512sum -c - \ - && mkdir -p /usr/share/dotnet \ - && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ - && rm dotnet.tar.gz \ - && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ - # Install ASP.NET Core - && curl -SL --output aspnetcore.tar.gz https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/$ASPNET_CORE_APP_60/aspnetcore-runtime-$ASPNET_CORE_APP_60-linux-x64.tar.gz \ - && echo "$ASPNET_CORE_APP_60_SHA aspnetcore.tar.gz" | sha512sum -c - \ - && mkdir -p /usr/share/dotnet \ - && tar -zxf aspnetcore.tar.gz -C /usr/share/dotnet ./shared/Microsoft.AspNetCore.App \ - && rm aspnetcore.tar.gz \ - && dotnet-sos install \ - && rm -rf ${BUILD_DIR} - -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ARG USER_DOTNET_AI_VERSION -ENV USER_DOTNET_AI_VERSION=${USER_DOTNET_AI_VERSION} -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -ENV DOTNET_VERSION="6.0" -ENV ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS=true -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -COPY DotNetCoreAgent.${USER_DOTNET_AI_VERSION}.zip /DotNetCoreAgent/appinsights.zip -RUN set -e \ - && echo $USER_DOTNET_AI_VERSION \ - && ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && apt-get update \ - && apt-get install unzip -y \ - && apt-get upgrade --assume-yes \ - && cd DotNetCoreAgent \ - && unzip appinsights.zip && rm appinsights.zip \ No newline at end of file diff --git a/images/runtime/php/8.1/apache2-foreground b/images/runtime/php/8.1/apache2-foreground deleted file mode 100755 index 5fe22e26f7..0000000000 --- a/images/runtime/php/8.1/apache2-foreground +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -set -e - -# Note: we don't just use "apache2ctl" here because it itself is just a shell-script wrapper around apache2 which provides extra functionality like "apache2ctl start" for launching apache2 in the background. -# (also, when run as "apache2ctl ", it does not use "exec", which leaves an undesirable resident shell process) - -: "${APACHE_CONFDIR:=/etc/apache2}" -: "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}" -if test -f "$APACHE_ENVVARS"; then - . "$APACHE_ENVVARS" -fi - -# Apache gets grumpy about PID files pre-existing -: "${APACHE_RUN_DIR:=/var/run/apache2}" -: "${APACHE_PID_FILE:=$APACHE_RUN_DIR/apache2.pid}" -rm -f "$APACHE_PID_FILE" - -# create missing directories -# (especially APACHE_RUN_DIR, APACHE_LOCK_DIR, and APACHE_LOG_DIR) -for e in "${!APACHE_@}"; do - if [[ "$e" == *_DIR ]] && [[ "${!e}" == /* ]]; then - # handle "/var/lock" being a symlink to "/run/lock", but "/run/lock" not existing beforehand, so "/var/lock/something" fails to mkdir - # mkdir: cannot create directory '/var/lock': File exists - dir="${!e}" - while [ "$dir" != "$(dirname "$dir")" ]; do - dir="$(dirname "$dir")" - if [ -d "$dir" ]; then - break - fi - absDir="$(readlink -f "$dir" 2>/dev/null || :)" - if [ -n "$absDir" ]; then - mkdir -p "$absDir" - fi - done - - mkdir -p "${!e}" - fi -done - -exec apache2 -DFOREGROUND "$@" diff --git a/images/runtime/php/8.1/bullseye.Dockerfile b/images/runtime/php/8.1/bullseye.Dockerfile deleted file mode 100644 index 9cb06a1cd6..0000000000 --- a/images/runtime/php/8.1/bullseye.Dockerfile +++ /dev/null @@ -1,463 +0,0 @@ -ARG BASE_IMAGE - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.1-bullseye as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen - -#FROM oryxdevmcr.azurecr.io/private/oryx/php-run-base-bullseye:{BUILD_NUMBER} -FROM ${BASE_IMAGE} -ARG IMAGES_DIR=/tmp/oryx/images - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -RUN set -eux \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - gnupg2 \ - apt-transport-https \ - && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && apt-get update \ - && ACCEPT_EULA=Y apt-get install -y msodbcsql17 msodbcsql18=18.1.2.1-1 odbcinst1debian2=2.3.7 odbcinst=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html -#### -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends apache2; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# delete the "index.html" that installing Apache drops in here - rm -rvf /var/www/html/*; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" - -# Apache + PHP requires preforking Apache for best results -RUN a2dismod mpm_event && a2enmod mpm_prefork - -# PHP files should be handled by PHP, and should be preferred over any other file type -RUN { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ - && a2enconf docker-php - -ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi ac_cv_func_mmap=no -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ARG PHP_VERSION -ARG PHP_SHA256 - -ENV PHP_VERSION ${PHP_VERSION} -ENV PHP_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz.asc/from/this/mirror" PHP_MD5="" -ENV PHP_SHA256 ${PHP_SHA256} - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - ${IMAGES_DIR}/receiveGpgKeys.sh $GPG_KEYS; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY images/runtime/php/8.1/docker-php-source /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-source - -RUN set -eux; \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libonig-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY images/runtime/php/8.1/docker-php-ext-* images/runtime/php/8.1/docker-php-entrypoint /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-* - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium \ - && rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["docker-php-entrypoint"] -#### -# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop -STOPSIGNAL SIGWINCH - -COPY images/runtime/php/8.1/apache2-foreground /usr/local/bin/ -RUN chmod +x /usr/local/bin/apache2-foreground -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### - -## base dockerfile -SHELL ["/bin/bash", "-c"] -ARG PHP_VERSION -ENV PHP_VERSION ${PHP_VERSION} - -RUN a2enmod rewrite expires include deflate remoteip headers - -ENV APACHE_RUN_USER www-data -# Edit the default DocumentRoot setting -ENV APACHE_DOCUMENT_ROOT /home/site/wwwroot -RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -# Edit the default port setting -ENV APACHE_PORT 8080 -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!Listen 80!Listen ${APACHE_PORT}!g' /etc/apache2/ports.conf -# Edit Configuration to instruct Apache on how to process PHP files -RUN echo -e '\n SetHandler application/x-httpd-php\n' >> /etc/apache2/apache2.conf -# Disable Apache2 server signature -RUN echo -e 'ServerSignature Off' >> /etc/apache2/apache2.conf -RUN echo -e 'ServerTokens Prod' >> /etc/apache2/apache2.conf -RUN { \ - echo ''; \ - echo ' Order deny,allow'; \ - echo ' Deny from all'; \ - echo ''; \ -} >> /etc/apache2/apache2.conf - -# Install common PHP extensions -# TEMPORARY: Holding odbc related packages from upgrading. -RUN apt-mark hold msodbcsql18 odbcinst1debian2 odbcinst unixodbc unixodbc-dev \ - && apt-get update \ - && apt-get upgrade -y \ - && ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ - && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \ - && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h - -RUN set -eux; \ - if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - else \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ - mysqli \ - opcache \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ - mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - imap \ - tidy \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# wddx \ -# xmlrpc \ - xsl - -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ - fi - -# https://github.com/Imagick/imagick/issues/331 -# https://github.com/ihneo/php/pull/24/files -RUN set -eux; \ - if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ - fi - -# deprecated from 5.*, so should be avoided -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ - fi - -# https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* -RUN set -eux; \ - if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ - echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ - && docker-php-ext-enable mysqlnd_azure; \ - fi - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -# For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 -RUN set -eux; \ - if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ - && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ - fi - -# Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) -RUN set -eux; \ - if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ - && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ - fi - -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ - echo 'opcache.fast_shutdown=1'; \ - echo 'opcache.enable_cli=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -# NOTE: zend_extension=opcache is already configured via docker-php-ext-install, above -RUN { \ - echo 'error_log=/var/log/apache2/php-error.log'; \ - echo 'display_errors=Off'; \ - echo 'log_errors=On'; \ - echo 'display_startup_errors=Off'; \ - echo 'date.timezone=UTC'; \ - } > /usr/local/etc/php/conf.d/php.ini - -RUN set -x \ - && docker-php-source extract \ - && cd /usr/src/php/ext/odbc \ - && phpize \ - && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ - && chmod +x ./configure \ - && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ - && rm -rf /var/lib/apt/lists/* - -RUN rm -rf /tmp/oryx - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -## dockerfile - -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -RUN ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && rm -rf /tmp/oryx \ - # Temporarily making sure apache2-foreground has permission - && chmod +x /usr/local/bin/apache2-foreground - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" \ No newline at end of file diff --git a/images/runtime/php/8.1/buster.Dockerfile b/images/runtime/php/8.1/buster.Dockerfile deleted file mode 100644 index 5c3ab620f4..0000000000 --- a/images/runtime/php/8.1/buster.Dockerfile +++ /dev/null @@ -1,464 +0,0 @@ -ARG BASE_IMAGE - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-buster as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen - -#FROM oryxdevmcr.azurecr.io/private/oryx/php-run-base-buster:${BUILD_NUMBER} -FROM ${BASE_IMAGE} -ARG IMAGES_DIR=/tmp/oryx/images - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -RUN set -eux \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - gnupg2 \ - apt-transport-https \ - && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && apt-get update \ - && ACCEPT_EULA=Y apt-get install -y msodbcsql17 msodbcsql18=18.1.2.1-1 odbcinst1debian2=2.3.7 odbcinst=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html -#### -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends apache2; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# delete the "index.html" that installing Apache drops in here - rm -rvf /var/www/html/*; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" - -# Apache + PHP requires preforking Apache for best results -RUN a2dismod mpm_event && a2enmod mpm_prefork - -# PHP files should be handled by PHP, and should be preferred over any other file type -RUN { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ - && a2enconf docker-php - -ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi ac_cv_func_mmap=no -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ARG PHP_VERSION -ARG PHP_SHA256 -ENV PHP_VERSION ${PHP_VERSION} -ENV PHP_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz.asc/from/this/mirror" PHP_MD5="" -ENV PHP_SHA256 ${PHP_SHA256} - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - ${IMAGES_DIR}/receiveGpgKeys.sh $GPG_KEYS; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY images/runtime/php/8.1/docker-php-source /usr/local/bin/ - -RUN chmod +x /usr/local/bin/docker-php-source - -RUN set -eux; \ - \ - - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libonig-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY images/runtime/php/8.1/docker-php-ext-* images/runtime/php/8.1/docker-php-entrypoint /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-* - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium \ - && rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["docker-php-entrypoint"] -#### -# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop -STOPSIGNAL SIGWINCH - -COPY images/runtime/php/8.1/apache2-foreground /usr/local/bin/ -RUN chmod +x /usr/local/bin/apache2-foreground -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### - - -## base dockerfile -SHELL ["/bin/bash", "-c"] - -RUN a2enmod rewrite expires include deflate remoteip headers - -ENV APACHE_RUN_USER www-data -# Edit the default DocumentRoot setting -ENV APACHE_DOCUMENT_ROOT /home/site/wwwroot -RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -# Edit the default port setting -ENV APACHE_PORT 8080 -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!Listen 80!Listen ${APACHE_PORT}!g' /etc/apache2/ports.conf -# Edit Configuration to instruct Apache on how to process PHP files -RUN echo -e '\n SetHandler application/x-httpd-php\n' >> /etc/apache2/apache2.conf -# Disable Apache2 server signature -RUN echo -e 'ServerSignature Off' >> /etc/apache2/apache2.conf -RUN echo -e 'ServerTokens Prod' >> /etc/apache2/apache2.conf -RUN { \ - echo ''; \ - echo ' Order deny,allow'; \ - echo ' Deny from all'; \ - echo ''; \ -} >> /etc/apache2/apache2.conf - -# Install common PHP extensions -# TEMPORARY: Holding odbc related packages from upgrading. -RUN apt-mark hold msodbcsql18 odbcinst1debian2 odbcinst unixodbc unixodbc-dev \ - && apt-get update \ - && apt-get upgrade -y \ - && ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ - && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \ - && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h - -RUN set -eux; \ - if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - else \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ - mysqli \ - opcache \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ - mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - imap \ - tidy \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# wddx \ -# xmlrpc \ - xsl - -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ - fi - -# https://github.com/Imagick/imagick/issues/331 -# https://github.com/ihneo/php/pull/24/files -RUN set -eux; \ - if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ - fi - -# deprecated from 5.*, so should be avoided -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ - fi - -# https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* -RUN set -eux; \ - if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ - echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ - && docker-php-ext-enable mysqlnd_azure; \ - fi - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -# For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 -RUN set -eux; \ - if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ - && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ - fi - -# Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) -RUN set -eux; \ - if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ - && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ - fi - -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ - echo 'opcache.fast_shutdown=1'; \ - echo 'opcache.enable_cli=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -# NOTE: zend_extension=opcache is already configured via docker-php-ext-install, above -RUN { \ - echo 'error_log=/var/log/apache2/php-error.log'; \ - echo 'display_errors=Off'; \ - echo 'log_errors=On'; \ - echo 'display_startup_errors=Off'; \ - echo 'date.timezone=UTC'; \ - } > /usr/local/etc/php/conf.d/php.ini - -RUN set -x \ - && docker-php-source extract \ - && cd /usr/src/php/ext/odbc \ - && phpize \ - && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ - && chmod +x ./configure \ - && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ - && rm -rf /var/lib/apt/lists/* - -RUN rm -rf /tmp/oryx - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -## dockerfile - -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -RUN ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && rm -rf /tmp/oryx \ - # Temporarily making sure apache2-foreground has permission - && chmod +x /usr/local/bin/apache2-foreground - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" \ No newline at end of file diff --git a/images/runtime/php/8.1/docker-php-entrypoint b/images/runtime/php/8.1/docker-php-entrypoint deleted file mode 100755 index 3d36d5e8cf..0000000000 --- a/images/runtime/php/8.1/docker-php-entrypoint +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e - -# first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- apache2-foreground "$@" -fi - -exec "$@" diff --git a/images/runtime/php/8.1/docker-php-ext-configure b/images/runtime/php/8.1/docker-php-ext-configure deleted file mode 100755 index 9e949e1e13..0000000000 --- a/images/runtime/php/8.1/docker-php-ext-configure +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 ext-name [configure flags]" - echo " ie: $0 gd --with-jpeg-dir=/usr/local/something" - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -ext="$1" -if [ -z "$ext" ] || [ ! -d "$ext" ]; then - usage >&2 - exit 1 -fi -shift - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS - fi -fi - -if command -v dpkg-architecture > /dev/null; then - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" - set -- --build="$gnuArch" "$@" -fi - -cd "$ext" -phpize -./configure "$@" diff --git a/images/runtime/php/8.1/docker-php-ext-enable b/images/runtime/php/8.1/docker-php-ext-enable deleted file mode 100755 index 3d079d2160..0000000000 --- a/images/runtime/php/8.1/docker-php-ext-enable +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -set -e - -extDir="$(php -d 'display_errors=stderr' -r 'echo ini_get("extension_dir");')" -cd "$extDir" - -usage() { - echo "usage: $0 [options] module-name [module-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 --ini-name 0-apc.ini apcu apc" - echo - echo 'Possible values for module-name:' - find -maxdepth 1 \ - -type f \ - -name '*.so' \ - -exec basename '{}' ';' \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -iniName= -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --ini-name) iniName="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -modules= -for module; do - if [ -z "$module" ]; then - continue - fi - if [ -f "$module.so" ] && ! [ -f "$module" ]; then - # allow ".so" to be optional - module="$module.so" - fi - if ! [ -f "$module" ]; then - echo >&2 "error: '$module' does not exist" - echo >&2 - usage >&2 - exit 1 - fi - modules="$modules $module" -done - -if [ -z "$modules" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual '.docker-php-ext-enable-deps' binutils - apkDel='.docker-php-ext-enable-deps' - fi -fi - -for module in $modules; do - if readelf --wide --syms "$module" | grep -q ' zend_extension_entry$'; then - # https://wiki.php.net/internals/extensions#loading_zend_extensions - absModule="$(readlink -f "$module")" - line="zend_extension=$absModule" - else - line="extension=$module" - fi - - ext="$(basename "$module")" - ext="${ext%.*}" - if php -d 'display_errors=stderr' -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then - # this isn't perfect, but it's better than nothing - # (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache') - echo >&2 - echo >&2 "warning: $ext ($module) is already loaded!" - echo >&2 - continue - fi - - ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}" - if ! grep -q "$line" "$ini" 2>/dev/null; then - echo "$line" >> "$ini" - fi -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi diff --git a/images/runtime/php/8.1/docker-php-ext-install b/images/runtime/php/8.1/docker-php-ext-install deleted file mode 100755 index 1afa66273b..0000000000 --- a/images/runtime/php/8.1/docker-php-ext-install +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 [-jN] ext-name [ext-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop" - echo - echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure' - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -j=1 -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --jobs|-j) j="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -exts= -for ext; do - if [ -z "$ext" ]; then - continue - fi - if [ ! -d "$ext" ]; then - echo >&2 "error: $PWD/$ext does not exist" - echo >&2 - usage >&2 - exit 1 - fi - exts="$exts $ext" -done - -if [ -z "$exts" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if [ -n "$PHPIZE_DEPS" ]; then - if apk info --installed .phpize-deps-configure > /dev/null; then - apkDel='.phpize-deps-configure' - elif ! apk info --installed .phpize-deps > /dev/null; then - apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS - apkDel='.phpize-deps' - fi - fi -fi - -popDir="$PWD" -for ext in $exts; do - cd "$ext" - [ -e Makefile ] || docker-php-ext-configure "$ext" - make -j"$j" - make -j"$j" install - find modules \ - -maxdepth 1 \ - -name '*.so' \ - -exec basename '{}' ';' \ - | xargs -r docker-php-ext-enable - make -j"$j" clean - cd "$popDir" -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi - -if [ -e /usr/src/php/.docker-delete-me ]; then - docker-php-source delete -fi diff --git a/images/runtime/php/8.1/docker-php-source b/images/runtime/php/8.1/docker-php-source deleted file mode 100755 index 9033d243de..0000000000 --- a/images/runtime/php/8.1/docker-php-source +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -dir=/usr/src/php - -usage() { - echo "usage: $0 COMMAND" - echo - echo "Manage php source tarball lifecycle." - echo - echo "Commands:" - echo " extract extract php source tarball into directory $dir if not already done." - echo " delete delete extracted php source located into $dir if not already done." - echo -} - -case "$1" in - extract) - mkdir -p "$dir" - if [ ! -f "$dir/.docker-extracted" ]; then - tar -Jxf /usr/src/php.tar.xz -C "$dir" --strip-components=1 - touch "$dir/.docker-extracted" - fi - ;; - - delete) - rm -rf "$dir" - ;; - - *) - usage - exit 1 - ;; -esac diff --git a/images/runtime/php/8.2/apache2-foreground b/images/runtime/php/8.2/apache2-foreground deleted file mode 100755 index 5fe22e26f7..0000000000 --- a/images/runtime/php/8.2/apache2-foreground +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -set -e - -# Note: we don't just use "apache2ctl" here because it itself is just a shell-script wrapper around apache2 which provides extra functionality like "apache2ctl start" for launching apache2 in the background. -# (also, when run as "apache2ctl ", it does not use "exec", which leaves an undesirable resident shell process) - -: "${APACHE_CONFDIR:=/etc/apache2}" -: "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}" -if test -f "$APACHE_ENVVARS"; then - . "$APACHE_ENVVARS" -fi - -# Apache gets grumpy about PID files pre-existing -: "${APACHE_RUN_DIR:=/var/run/apache2}" -: "${APACHE_PID_FILE:=$APACHE_RUN_DIR/apache2.pid}" -rm -f "$APACHE_PID_FILE" - -# create missing directories -# (especially APACHE_RUN_DIR, APACHE_LOCK_DIR, and APACHE_LOG_DIR) -for e in "${!APACHE_@}"; do - if [[ "$e" == *_DIR ]] && [[ "${!e}" == /* ]]; then - # handle "/var/lock" being a symlink to "/run/lock", but "/run/lock" not existing beforehand, so "/var/lock/something" fails to mkdir - # mkdir: cannot create directory '/var/lock': File exists - dir="${!e}" - while [ "$dir" != "$(dirname "$dir")" ]; do - dir="$(dirname "$dir")" - if [ -d "$dir" ]; then - break - fi - absDir="$(readlink -f "$dir" 2>/dev/null || :)" - if [ -n "$absDir" ]; then - mkdir -p "$absDir" - fi - done - - mkdir -p "${!e}" - fi -done - -exec apache2 -DFOREGROUND "$@" diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile deleted file mode 100644 index 9d86931eb6..0000000000 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ /dev/null @@ -1,461 +0,0 @@ -ARG BASE_IMAGE - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.1-bullseye as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen - -# From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} -ARG IMAGES_DIR=/tmp/oryx/images - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -RUN set -eux \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - gnupg2 \ - apt-transport-https \ - && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && apt-get update \ - && ACCEPT_EULA=Y apt-get install -y msodbcsql17 msodbcsql18=18.1.2.1-1 odbcinst1debian2=2.3.7 odbcinst=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html -#### -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends apache2; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# delete the "index.html" that installing Apache drops in here - rm -rvf /var/www/html/*; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" - -# Apache + PHP requires preforking Apache for best results -RUN a2dismod mpm_event && a2enmod mpm_prefork - -# PHP files should be handled by PHP, and should be preferred over any other file type -RUN { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ - && a2enconf docker-php - -ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi ac_cv_func_mmap=no -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A - -ARG PHP_VERSION -ARG PHP_SHA256 -ENV PHP_VERSION ${PHP_VERSION} -ENV PHP_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz.asc/from/this/mirror" PHP_MD5="" -ENV PHP_SHA256 ${PHP_SHA256} - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - ${IMAGES_DIR}/receiveGpgKeys.sh $GPG_KEYS; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY images/runtime/php/8.2/docker-php-source /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-source - -RUN set -eux; \ - \ - - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libonig-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY images/runtime/php/8.2/docker-php-ext-* images/runtime/php/8.2/docker-php-entrypoint /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-* - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium \ - && rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["docker-php-entrypoint"] -#### -# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop -STOPSIGNAL SIGWINCH - -COPY images/runtime/php/8.2/apache2-foreground /usr/local/bin/ -RUN chmod +x /usr/local/bin/apache2-foreground -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### - -## base dockerfile -SHELL ["/bin/bash", "-c"] - -RUN a2enmod rewrite expires include deflate remoteip headers - -ENV APACHE_RUN_USER www-data -# Edit the default DocumentRoot setting -ENV APACHE_DOCUMENT_ROOT /home/site/wwwroot -RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -# Edit the default port setting -ENV APACHE_PORT 8080 -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!Listen 80!Listen ${APACHE_PORT}!g' /etc/apache2/ports.conf -# Edit Configuration to instruct Apache on how to process PHP files -RUN echo -e '\n SetHandler application/x-httpd-php\n' >> /etc/apache2/apache2.conf -# Disable Apache2 server signature -RUN echo -e 'ServerSignature Off' >> /etc/apache2/apache2.conf -RUN echo -e 'ServerTokens Prod' >> /etc/apache2/apache2.conf -RUN { \ - echo ''; \ - echo ' Order deny,allow'; \ - echo ' Deny from all'; \ - echo ''; \ -} >> /etc/apache2/apache2.conf - -# Install common PHP extensions -# TEMPORARY: Holding odbc related packages from upgrading. -RUN apt-mark hold msodbcsql18 odbcinst1debian2 odbcinst unixodbc unixodbc-dev \ - && apt-get update \ - && apt-get upgrade -y \ - && ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ - && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \ - && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h - -RUN set -eux; \ - if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - else \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ - mysqli \ - opcache \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ - mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - imap \ - tidy \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# wddx \ -# xmlrpc \ - xsl - -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ - fi - -# https://github.com/Imagick/imagick/issues/331 -# https://github.com/ihneo/php/pull/24/files -RUN set -eux; \ - if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ - fi - -# deprecated from 5.*, so should be avoided -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ - fi - -# https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* -RUN set -eux; \ - if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ - echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ - && docker-php-ext-enable mysqlnd_azure; \ - fi - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -# For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 -RUN set -eux; \ - if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ - && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ - fi - -# Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) -RUN set -eux; \ - if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ - && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ - fi - -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ - echo 'opcache.fast_shutdown=1'; \ - echo 'opcache.enable_cli=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -# NOTE: zend_extension=opcache is already configured via docker-php-ext-install, above -RUN { \ - echo 'error_log=/var/log/apache2/php-error.log'; \ - echo 'display_errors=Off'; \ - echo 'log_errors=On'; \ - echo 'display_startup_errors=Off'; \ - echo 'date.timezone=UTC'; \ - } > /usr/local/etc/php/conf.d/php.ini - -RUN set -x \ - && docker-php-source extract \ - && cd /usr/src/php/ext/odbc \ - && phpize \ - && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ - && chmod +x ./configure \ - && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ - && rm -rf /var/lib/apt/lists/* - -RUN rm -rf /tmp/oryx - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -# dockerfile -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -RUN ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && rm -rf /tmp/oryx \ - # Temporarily making sure apache2-foreground has permission - && chmod +x /usr/local/bin/apache2-foreground - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" \ No newline at end of file diff --git a/images/runtime/php/8.2/buster.Dockerfile b/images/runtime/php/8.2/buster.Dockerfile deleted file mode 100644 index fd47044de3..0000000000 --- a/images/runtime/php/8.2/buster.Dockerfile +++ /dev/null @@ -1,460 +0,0 @@ -ARG BASE_IMAGE - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-buster as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen - -FROM ${BASE_IMAGE} -ARG IMAGES_DIR=/tmp/oryx/images - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -RUN set -eux \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - gnupg2 \ - apt-transport-https \ - && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && apt-get update \ - && ACCEPT_EULA=Y apt-get install -y msodbcsql17 msodbcsql18=18.1.2.1-1 odbcinst1debian2=2.3.7 odbcinst=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html -#### -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends apache2; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# delete the "index.html" that installing Apache drops in here - rm -rvf /var/www/html/*; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" - -# Apache + PHP requires preforking Apache for best results -RUN a2dismod mpm_event && a2enmod mpm_prefork - -# PHP files should be handled by PHP, and should be preferred over any other file type -RUN { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ - && a2enconf docker-php - -ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi ac_cv_func_mmap=no -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A - -ARG PHP_VERSION -ARG PHP_SHA256 -ENV PHP_VERSION ${PHP_VERSION} -ENV PHP_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz.asc/from/this/mirror" PHP_MD5="" -ENV PHP_SHA256 ${PHP_SHA256} - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - ${IMAGES_DIR}/receiveGpgKeys.sh $GPG_KEYS; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY images/runtime/php/8.2/docker-php-source /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-source - -RUN set -eux; \ - \ - - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libonig-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY images/runtime/php/8.2/docker-php-ext-* images/runtime/php/8.2/docker-php-entrypoint /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-* - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium \ - && rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["docker-php-entrypoint"] -#### -# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop -STOPSIGNAL SIGWINCH - -COPY images/runtime/php/8.2/apache2-foreground /usr/local/bin/ -RUN chmod +x /usr/local/bin/apache2-foreground -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### - -## base dockerfile -SHELL ["/bin/bash", "-c"] - -RUN a2enmod rewrite expires include deflate remoteip headers - -ENV APACHE_RUN_USER www-data -# Edit the default DocumentRoot setting -ENV APACHE_DOCUMENT_ROOT /home/site/wwwroot -RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -# Edit the default port setting -ENV APACHE_PORT 8080 -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!Listen 80!Listen ${APACHE_PORT}!g' /etc/apache2/ports.conf -# Edit Configuration to instruct Apache on how to process PHP files -RUN echo -e '\n SetHandler application/x-httpd-php\n' >> /etc/apache2/apache2.conf -# Disable Apache2 server signature -RUN echo -e 'ServerSignature Off' >> /etc/apache2/apache2.conf -RUN echo -e 'ServerTokens Prod' >> /etc/apache2/apache2.conf -RUN { \ - echo ''; \ - echo ' Order deny,allow'; \ - echo ' Deny from all'; \ - echo ''; \ -} >> /etc/apache2/apache2.conf - -# Install common PHP extensions -# TEMPORARY: Holding odbc related packages from upgrading. -RUN apt-mark hold msodbcsql18 odbcinst1debian2 odbcinst unixodbc unixodbc-dev \ - && apt-get update \ - && apt-get upgrade -y \ - && ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ - && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \ - && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h - -RUN set -eux; \ - if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - else \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ - mysqli \ - opcache \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ - mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - imap \ - tidy \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# wddx \ -# xmlrpc \ - xsl - -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ - fi - -# https://github.com/Imagick/imagick/issues/331 -# https://github.com/ihneo/php/pull/24/files -RUN set -eux; \ - if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ - fi - -# deprecated from 5.*, so should be avoided -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ - fi - -# https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* -RUN set -eux; \ - if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ - echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ - && docker-php-ext-enable mysqlnd_azure; \ - fi - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -# For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 -RUN set -eux; \ - if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ - && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ - fi - -# Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) -RUN set -eux; \ - if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ - && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ - fi - -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ - echo 'opcache.fast_shutdown=1'; \ - echo 'opcache.enable_cli=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -# NOTE: zend_extension=opcache is already configured via docker-php-ext-install, above -RUN { \ - echo 'error_log=/var/log/apache2/php-error.log'; \ - echo 'display_errors=Off'; \ - echo 'log_errors=On'; \ - echo 'display_startup_errors=Off'; \ - echo 'date.timezone=UTC'; \ - } > /usr/local/etc/php/conf.d/php.ini - -RUN set -x \ - && docker-php-source extract \ - && cd /usr/src/php/ext/odbc \ - && phpize \ - && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ - && chmod +x ./configure \ - && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ - && rm -rf /var/lib/apt/lists/* - -RUN rm -rf /tmp/oryx - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -# dockerfile -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -RUN ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && rm -rf /tmp/oryx \ - # Temporarily making sure apache2-foreground has permission - && chmod +x /usr/local/bin/apache2-foreground - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" \ No newline at end of file diff --git a/images/runtime/php/8.2/docker-php-entrypoint b/images/runtime/php/8.2/docker-php-entrypoint deleted file mode 100755 index 3d36d5e8cf..0000000000 --- a/images/runtime/php/8.2/docker-php-entrypoint +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e - -# first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- apache2-foreground "$@" -fi - -exec "$@" diff --git a/images/runtime/php/8.2/docker-php-ext-configure b/images/runtime/php/8.2/docker-php-ext-configure deleted file mode 100755 index 9e949e1e13..0000000000 --- a/images/runtime/php/8.2/docker-php-ext-configure +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 ext-name [configure flags]" - echo " ie: $0 gd --with-jpeg-dir=/usr/local/something" - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -ext="$1" -if [ -z "$ext" ] || [ ! -d "$ext" ]; then - usage >&2 - exit 1 -fi -shift - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS - fi -fi - -if command -v dpkg-architecture > /dev/null; then - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" - set -- --build="$gnuArch" "$@" -fi - -cd "$ext" -phpize -./configure "$@" diff --git a/images/runtime/php/8.2/docker-php-ext-enable b/images/runtime/php/8.2/docker-php-ext-enable deleted file mode 100755 index 3d079d2160..0000000000 --- a/images/runtime/php/8.2/docker-php-ext-enable +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -set -e - -extDir="$(php -d 'display_errors=stderr' -r 'echo ini_get("extension_dir");')" -cd "$extDir" - -usage() { - echo "usage: $0 [options] module-name [module-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 --ini-name 0-apc.ini apcu apc" - echo - echo 'Possible values for module-name:' - find -maxdepth 1 \ - -type f \ - -name '*.so' \ - -exec basename '{}' ';' \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -iniName= -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --ini-name) iniName="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -modules= -for module; do - if [ -z "$module" ]; then - continue - fi - if [ -f "$module.so" ] && ! [ -f "$module" ]; then - # allow ".so" to be optional - module="$module.so" - fi - if ! [ -f "$module" ]; then - echo >&2 "error: '$module' does not exist" - echo >&2 - usage >&2 - exit 1 - fi - modules="$modules $module" -done - -if [ -z "$modules" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual '.docker-php-ext-enable-deps' binutils - apkDel='.docker-php-ext-enable-deps' - fi -fi - -for module in $modules; do - if readelf --wide --syms "$module" | grep -q ' zend_extension_entry$'; then - # https://wiki.php.net/internals/extensions#loading_zend_extensions - absModule="$(readlink -f "$module")" - line="zend_extension=$absModule" - else - line="extension=$module" - fi - - ext="$(basename "$module")" - ext="${ext%.*}" - if php -d 'display_errors=stderr' -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then - # this isn't perfect, but it's better than nothing - # (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache') - echo >&2 - echo >&2 "warning: $ext ($module) is already loaded!" - echo >&2 - continue - fi - - ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}" - if ! grep -q "$line" "$ini" 2>/dev/null; then - echo "$line" >> "$ini" - fi -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi diff --git a/images/runtime/php/8.2/docker-php-ext-install b/images/runtime/php/8.2/docker-php-ext-install deleted file mode 100755 index 1afa66273b..0000000000 --- a/images/runtime/php/8.2/docker-php-ext-install +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 [-jN] ext-name [ext-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop" - echo - echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure' - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -j=1 -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --jobs|-j) j="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -exts= -for ext; do - if [ -z "$ext" ]; then - continue - fi - if [ ! -d "$ext" ]; then - echo >&2 "error: $PWD/$ext does not exist" - echo >&2 - usage >&2 - exit 1 - fi - exts="$exts $ext" -done - -if [ -z "$exts" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if [ -n "$PHPIZE_DEPS" ]; then - if apk info --installed .phpize-deps-configure > /dev/null; then - apkDel='.phpize-deps-configure' - elif ! apk info --installed .phpize-deps > /dev/null; then - apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS - apkDel='.phpize-deps' - fi - fi -fi - -popDir="$PWD" -for ext in $exts; do - cd "$ext" - [ -e Makefile ] || docker-php-ext-configure "$ext" - make -j"$j" - make -j"$j" install - find modules \ - -maxdepth 1 \ - -name '*.so' \ - -exec basename '{}' ';' \ - | xargs -r docker-php-ext-enable - make -j"$j" clean - cd "$popDir" -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi - -if [ -e /usr/src/php/.docker-delete-me ]; then - docker-php-source delete -fi diff --git a/images/runtime/php/8.2/docker-php-source b/images/runtime/php/8.2/docker-php-source deleted file mode 100755 index 9033d243de..0000000000 --- a/images/runtime/php/8.2/docker-php-source +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -dir=/usr/src/php - -usage() { - echo "usage: $0 COMMAND" - echo - echo "Manage php source tarball lifecycle." - echo - echo "Commands:" - echo " extract extract php source tarball into directory $dir if not already done." - echo " delete delete extracted php source located into $dir if not already done." - echo -} - -case "$1" in - extract) - mkdir -p "$dir" - if [ ! -f "$dir/.docker-extracted" ]; then - tar -Jxf /usr/src/php.tar.xz -C "$dir" --strip-components=1 - touch "$dir/.docker-extracted" - fi - ;; - - delete) - rm -rf "$dir" - ;; - - *) - usage - exit 1 - ;; -esac diff --git a/images/runtime/php/8.3/apache2-foreground b/images/runtime/php/8.3/apache2-foreground deleted file mode 100755 index 5fe22e26f7..0000000000 --- a/images/runtime/php/8.3/apache2-foreground +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -set -e - -# Note: we don't just use "apache2ctl" here because it itself is just a shell-script wrapper around apache2 which provides extra functionality like "apache2ctl start" for launching apache2 in the background. -# (also, when run as "apache2ctl ", it does not use "exec", which leaves an undesirable resident shell process) - -: "${APACHE_CONFDIR:=/etc/apache2}" -: "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}" -if test -f "$APACHE_ENVVARS"; then - . "$APACHE_ENVVARS" -fi - -# Apache gets grumpy about PID files pre-existing -: "${APACHE_RUN_DIR:=/var/run/apache2}" -: "${APACHE_PID_FILE:=$APACHE_RUN_DIR/apache2.pid}" -rm -f "$APACHE_PID_FILE" - -# create missing directories -# (especially APACHE_RUN_DIR, APACHE_LOCK_DIR, and APACHE_LOG_DIR) -for e in "${!APACHE_@}"; do - if [[ "$e" == *_DIR ]] && [[ "${!e}" == /* ]]; then - # handle "/var/lock" being a symlink to "/run/lock", but "/run/lock" not existing beforehand, so "/var/lock/something" fails to mkdir - # mkdir: cannot create directory '/var/lock': File exists - dir="${!e}" - while [ "$dir" != "$(dirname "$dir")" ]; do - dir="$(dirname "$dir")" - if [ -d "$dir" ]; then - break - fi - absDir="$(readlink -f "$dir" 2>/dev/null || :)" - if [ -n "$absDir" ]; then - mkdir -p "$absDir" - fi - done - - mkdir -p "${!e}" - fi -done - -exec apache2 -DFOREGROUND "$@" diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile deleted file mode 100644 index f2598ae18b..0000000000 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ /dev/null @@ -1,463 +0,0 @@ -ARG BASE_IMAGE - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.1-bookworm as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen - -# From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} -ARG IMAGES_DIR=/tmp/oryx/images - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -RUN set -eux \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - gnupg2 \ - apt-transport-https \ - && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && curl https://packages.microsoft.com/config/debian/12/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \ - && apt-get update \ - && ACCEPT_EULA=Y apt-get install -y msodbcsql17=17.10.6.1-1 msodbcsql18=18.3.3.1-1 odbcinst1debian2=2.3.11-2+deb12u1 odbcinst=2.3.11-2+deb12u1 unixodbc=2.3.11-2+deb12u1 unixodbc-dev=2.3.11-2+deb12u1 - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html -#### -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends apache2; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# delete the "index.html" that installing Apache drops in here - rm -rvf /var/www/html/*; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" - -# Apache + PHP requires preforking Apache for best results -RUN a2dismod mpm_event && a2enmod mpm_prefork - -# PHP files should be handled by PHP, and should be preferred over any other file type -RUN { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ - && a2enconf docker-php - -ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi ac_cv_func_mmap=no -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC AFD8691FDAEDF03BDF6E460563F15A9B715376CA C28D937575603EB4ABB725861C0779DC5C0A9DE4 - -ARG PHP_VERSION -ARG PHP_SHA256 -ENV PHP_VERSION ${PHP_VERSION} -ENV PHP_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz.asc/from/this/mirror" PHP_MD5="" -ENV PHP_SHA256 ${PHP_SHA256} - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - ${IMAGES_DIR}/receiveGpgKeys.sh $GPG_KEYS; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY images/runtime/php/8.3/docker-php-source /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-source - -RUN set -eux; \ - \ - - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libonig-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - #apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - #\ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY images/runtime/php/8.3/docker-php-ext-* images/runtime/php/8.3/docker-php-entrypoint /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-* - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium \ - && rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["docker-php-entrypoint"] -#### -# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop -STOPSIGNAL SIGWINCH - -COPY images/runtime/php/8.3/apache2-foreground /usr/local/bin/ -RUN chmod +x /usr/local/bin/apache2-foreground -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### - -## base dockerfile -SHELL ["/bin/bash", "-c"] - - -RUN a2enmod rewrite expires include deflate remoteip headers - -ENV APACHE_RUN_USER www-data -# Edit the default DocumentRoot setting -ENV APACHE_DOCUMENT_ROOT /home/site/wwwroot -RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -# Edit the default port setting -ENV APACHE_PORT 8080 -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!Listen 80!Listen ${APACHE_PORT}!g' /etc/apache2/ports.conf -# Edit Configuration to instruct Apache on how to process PHP files -RUN echo -e '\n SetHandler application/x-httpd-php\n' >> /etc/apache2/apache2.conf -# Disable Apache2 server signature -RUN echo -e 'ServerSignature Off' >> /etc/apache2/apache2.conf -RUN echo -e 'ServerTokens Prod' >> /etc/apache2/apache2.conf -RUN { \ - echo ''; \ - echo ' Order deny,allow'; \ - echo ' Deny from all'; \ - echo ''; \ -} >> /etc/apache2/apache2.conf - -# Install common PHP extensions -# TEMPORARY: Holding odbc related packages from upgrading. -RUN apt-mark hold msodbcsql18 odbcinst1debian2 odbcinst unixodbc unixodbc-dev \ - && apt-get update \ - && apt-get upgrade -y \ - && ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ - && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \ - && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h - -RUN set -eux; \ - if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - else \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ - mysqli \ - opcache \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ - mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - imap \ - tidy \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# wddx \ -# xmlrpc \ - xsl - -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ - fi - -# https://github.com/Imagick/imagick/issues/331 -# https://github.com/ihneo/php/pull/24/files -RUN set -eux; \ - if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ - fi - -# deprecated from 5.*, so should be avoided -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ - fi - -# https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* -RUN set -eux; \ - if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ - echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ - && docker-php-ext-enable mysqlnd_azure; \ - fi - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -# For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 -RUN set -eux; \ - if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ - && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ - fi - -# Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) -RUN set -eux; \ - if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ - && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ - fi - -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ - echo 'opcache.fast_shutdown=1'; \ - echo 'opcache.enable_cli=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -# NOTE: zend_extension=opcache is already configured via docker-php-ext-install, above -RUN { \ - echo 'error_log=/var/log/apache2/php-error.log'; \ - echo 'display_errors=Off'; \ - echo 'log_errors=On'; \ - echo 'display_startup_errors=Off'; \ - echo 'date.timezone=UTC'; \ - } > /usr/local/etc/php/conf.d/php.ini - -RUN set -x \ - && docker-php-source extract \ - && cd /usr/src/php/ext/odbc \ - && phpize \ - && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ - && chmod +x ./configure \ - && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ - && rm -rf /var/lib/apt/lists/* - -RUN rm -rf /tmp/oryx - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -# dockerfile -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -RUN ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && rm -rf /tmp/oryx \ - # Temporarily making sure apache2-foreground has permission - && chmod +x /usr/local/bin/apache2-foreground - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" \ No newline at end of file diff --git a/images/runtime/php/8.3/bullseye.Dockerfile b/images/runtime/php/8.3/bullseye.Dockerfile deleted file mode 100644 index d2dd6579ab..0000000000 --- a/images/runtime/php/8.3/bullseye.Dockerfile +++ /dev/null @@ -1,461 +0,0 @@ -ARG BASE_IMAGE - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.1-bullseye as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen - -# From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} -ARG IMAGES_DIR=/tmp/oryx/images - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -RUN set -eux \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - gnupg2 \ - apt-transport-https \ - && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && apt-get update \ - && ACCEPT_EULA=Y apt-get install -y msodbcsql17 msodbcsql18=18.1.2.1-1 odbcinst1debian2=2.3.7 odbcinst=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html -#### -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends apache2; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# delete the "index.html" that installing Apache drops in here - rm -rvf /var/www/html/*; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" - -# Apache + PHP requires preforking Apache for best results -RUN a2dismod mpm_event && a2enmod mpm_prefork - -# PHP files should be handled by PHP, and should be preferred over any other file type -RUN { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ - && a2enconf docker-php - -ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi ac_cv_func_mmap=no -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC AFD8691FDAEDF03BDF6E460563F15A9B715376CA C28D937575603EB4ABB725861C0779DC5C0A9DE4 - -ARG PHP_VERSION -ARG PHP_SHA256 -ENV PHP_VERSION ${PHP_VERSION} -ENV PHP_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz.asc/from/this/mirror" PHP_MD5="" -ENV PHP_SHA256 ${PHP_SHA256} - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - ${IMAGES_DIR}/receiveGpgKeys.sh $GPG_KEYS; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY images/runtime/php/8.3/docker-php-source /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-source - -RUN set -eux; \ - \ - - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libonig-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY images/runtime/php/8.3/docker-php-ext-* images/runtime/php/8.3/docker-php-entrypoint /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-* - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium \ - && rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["docker-php-entrypoint"] -#### -# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop -STOPSIGNAL SIGWINCH - -COPY images/runtime/php/8.3/apache2-foreground /usr/local/bin/ -RUN chmod +x /usr/local/bin/apache2-foreground -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### - -## base dockerfile -SHELL ["/bin/bash", "-c"] - -RUN a2enmod rewrite expires include deflate remoteip headers - -ENV APACHE_RUN_USER www-data -# Edit the default DocumentRoot setting -ENV APACHE_DOCUMENT_ROOT /home/site/wwwroot -RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -# Edit the default port setting -ENV APACHE_PORT 8080 -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!Listen 80!Listen ${APACHE_PORT}!g' /etc/apache2/ports.conf -# Edit Configuration to instruct Apache on how to process PHP files -RUN echo -e '\n SetHandler application/x-httpd-php\n' >> /etc/apache2/apache2.conf -# Disable Apache2 server signature -RUN echo -e 'ServerSignature Off' >> /etc/apache2/apache2.conf -RUN echo -e 'ServerTokens Prod' >> /etc/apache2/apache2.conf -RUN { \ - echo ''; \ - echo ' Order deny,allow'; \ - echo ' Deny from all'; \ - echo ''; \ -} >> /etc/apache2/apache2.conf - -# Install common PHP extensions -# TEMPORARY: Holding odbc related packages from upgrading. -RUN apt-mark hold msodbcsql18 odbcinst1debian2 odbcinst unixodbc unixodbc-dev \ - && apt-get update \ - && apt-get upgrade -y \ - && ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ - && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \ - && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h - -RUN set -eux; \ - if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - else \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ - mysqli \ - opcache \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ - mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - imap \ - tidy \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# wddx \ -# xmlrpc \ - xsl - -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ - fi - -# https://github.com/Imagick/imagick/issues/331 -# https://github.com/ihneo/php/pull/24/files -RUN set -eux; \ - if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ - fi - -# deprecated from 5.*, so should be avoided -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ - fi - -# https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* -RUN set -eux; \ - if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ - echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ - && docker-php-ext-enable mysqlnd_azure; \ - fi - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -# For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 -RUN set -eux; \ - if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ - && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ - fi - -# Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) -RUN set -eux; \ - if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ - && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ - fi - -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ - echo 'opcache.fast_shutdown=1'; \ - echo 'opcache.enable_cli=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -# NOTE: zend_extension=opcache is already configured via docker-php-ext-install, above -RUN { \ - echo 'error_log=/var/log/apache2/php-error.log'; \ - echo 'display_errors=Off'; \ - echo 'log_errors=On'; \ - echo 'display_startup_errors=Off'; \ - echo 'date.timezone=UTC'; \ - } > /usr/local/etc/php/conf.d/php.ini - -RUN set -x \ - && docker-php-source extract \ - && cd /usr/src/php/ext/odbc \ - && phpize \ - && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ - && chmod +x ./configure \ - && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ - && rm -rf /var/lib/apt/lists/* - -RUN rm -rf /tmp/oryx - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -# dockerfile -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -RUN ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && rm -rf /tmp/oryx \ - # Temporarily making sure apache2-foreground has permission - && chmod +x /usr/local/bin/apache2-foreground - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" \ No newline at end of file diff --git a/images/runtime/php/8.3/buster.Dockerfile b/images/runtime/php/8.3/buster.Dockerfile deleted file mode 100644 index 69a6e1f3ce..0000000000 --- a/images/runtime/php/8.3/buster.Dockerfile +++ /dev/null @@ -1,461 +0,0 @@ -ARG BASE_IMAGE - -# Startup script generator -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-bullseye as startupCmdGen - -# GOPATH is set to "/go" in the base image -WORKDIR /go/src -COPY src/startupscriptgenerator/src . -ARG GIT_COMMIT=unspecified -ARG BUILD_NUMBER=unspecified -ARG RELEASE_TAG_NAME=unspecified -ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} -ENV GIT_COMMIT=${GIT_COMMIT} -ENV BUILD_NUMBER=${BUILD_NUMBER} -RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen - -# From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} -ARG IMAGES_DIR=/tmp/oryx/images - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -RUN set -eux \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - gnupg2 \ - apt-transport-https \ - && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && apt-get update \ - && ACCEPT_EULA=Y apt-get install -y msodbcsql17 msodbcsql18=18.1.2.1-1 odbcinst1debian2=2.3.7 odbcinst=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html -#### -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends apache2; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# delete the "index.html" that installing Apache drops in here - rm -rvf /var/www/html/*; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" - -# Apache + PHP requires preforking Apache for best results -RUN a2dismod mpm_event && a2enmod mpm_prefork - -# PHP files should be handled by PHP, and should be preferred over any other file type -RUN { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ - && a2enconf docker-php - -ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi ac_cv_func_mmap=no -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC AFD8691FDAEDF03BDF6E460563F15A9B715376CA C28D937575603EB4ABB725861C0779DC5C0A9DE4 - -ARG PHP_VERSION -ARG PHP_SHA256 -ENV PHP_VERSION ${PHP_VERSION} -ENV PHP_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-${PHP_VERSION}.tar.xz.asc/from/this/mirror" PHP_MD5="" -ENV PHP_SHA256$ {PHP_SHA256} - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - ${IMAGES_DIR}/receiveGpgKeys.sh $GPG_KEYS; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY images/runtime/php/8.3/docker-php-source /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-source - -RUN set -eux; \ - \ - - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libonig-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY images/runtime/php/8.3/docker-php-ext-* images/runtime/php/8.3/docker-php-entrypoint /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-php-* - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium \ - && rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["docker-php-entrypoint"] -#### -# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop -STOPSIGNAL SIGWINCH - -COPY images/runtime/php/8.3/apache2-foreground /usr/local/bin/ -RUN chmod +x /usr/local/bin/apache2-foreground -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### - -## base dockerfile -SHELL ["/bin/bash", "-c"] - -RUN a2enmod rewrite expires include deflate remoteip headers - -ENV APACHE_RUN_USER www-data -# Edit the default DocumentRoot setting -ENV APACHE_DOCUMENT_ROOT /home/site/wwwroot -RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -# Edit the default port setting -ENV APACHE_PORT 8080 -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!!!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!Listen 80!Listen ${APACHE_PORT}!g' /etc/apache2/ports.conf -# Edit Configuration to instruct Apache on how to process PHP files -RUN echo -e '\n SetHandler application/x-httpd-php\n' >> /etc/apache2/apache2.conf -# Disable Apache2 server signature -RUN echo -e 'ServerSignature Off' >> /etc/apache2/apache2.conf -RUN echo -e 'ServerTokens Prod' >> /etc/apache2/apache2.conf -RUN { \ - echo ''; \ - echo ' Order deny,allow'; \ - echo ' Deny from all'; \ - echo ''; \ -} >> /etc/apache2/apache2.conf - -# Install common PHP extensions -# TEMPORARY: Holding odbc related packages from upgrading. -RUN apt-mark hold msodbcsql18 odbcinst1debian2 odbcinst unixodbc unixodbc-dev \ - && apt-get update \ - && apt-get upgrade -y \ - && ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ - && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \ - && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h - -RUN set -eux; \ - if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - else \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ - mysqli \ - opcache \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ - mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - imap \ - tidy \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# wddx \ -# xmlrpc \ - xsl - -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ - fi - -# https://github.com/Imagick/imagick/issues/331 -# https://github.com/ihneo/php/pull/24/files -RUN set -eux; \ - if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ - fi - -# deprecated from 5.*, so should be avoided -RUN set -eux; \ - if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ - fi - -# https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* -RUN set -eux; \ - if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ - echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ - && docker-php-ext-enable mysqlnd_azure; \ - fi - -# Install the Microsoft SQL Server PDO driver on supported versions only. -# - https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac -# - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -# For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 -RUN set -eux; \ - if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ - && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ - fi - -# Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) -RUN set -eux; \ - if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ - && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ - && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ - fi - -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ - echo 'opcache.fast_shutdown=1'; \ - echo 'opcache.enable_cli=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -# NOTE: zend_extension=opcache is already configured via docker-php-ext-install, above -RUN { \ - echo 'error_log=/var/log/apache2/php-error.log'; \ - echo 'display_errors=Off'; \ - echo 'log_errors=On'; \ - echo 'display_startup_errors=Off'; \ - echo 'date.timezone=UTC'; \ - } > /usr/local/etc/php/conf.d/php.ini - -RUN set -x \ - && docker-php-source extract \ - && cd /usr/src/php/ext/odbc \ - && phpize \ - && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ - && chmod +x ./configure \ - && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ - && rm -rf /var/lib/apt/lists/* - -RUN rm -rf /tmp/oryx - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" - -# dockerfile -# Bake Application Insights key from pipeline variable into final image -ARG AI_CONNECTION_STRING -ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} -#Bake in client certificate path into image to avoid downloading it -ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" - -# Oryx++ Builder variables -ENV CNB_STACK_ID="oryx.stacks.skeleton" -LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" - -COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen -RUN ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ - && rm -rf /tmp/oryx \ - # Temporarily making sure apache2-foreground has permission - && chmod +x /usr/local/bin/apache2-foreground - -ENV LANG="C.UTF-8" \ - LANGUAGE="C.UTF-8" \ - LC_ALL="C.UTF-8" \ No newline at end of file diff --git a/images/runtime/php/8.3/docker-php-entrypoint b/images/runtime/php/8.3/docker-php-entrypoint deleted file mode 100755 index 3d36d5e8cf..0000000000 --- a/images/runtime/php/8.3/docker-php-entrypoint +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e - -# first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- apache2-foreground "$@" -fi - -exec "$@" diff --git a/images/runtime/php/8.3/docker-php-ext-configure b/images/runtime/php/8.3/docker-php-ext-configure deleted file mode 100755 index 9e949e1e13..0000000000 --- a/images/runtime/php/8.3/docker-php-ext-configure +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 ext-name [configure flags]" - echo " ie: $0 gd --with-jpeg-dir=/usr/local/something" - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -ext="$1" -if [ -z "$ext" ] || [ ! -d "$ext" ]; then - usage >&2 - exit 1 -fi -shift - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS - fi -fi - -if command -v dpkg-architecture > /dev/null; then - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" - set -- --build="$gnuArch" "$@" -fi - -cd "$ext" -phpize -./configure "$@" diff --git a/images/runtime/php/8.3/docker-php-ext-enable b/images/runtime/php/8.3/docker-php-ext-enable deleted file mode 100755 index 3d079d2160..0000000000 --- a/images/runtime/php/8.3/docker-php-ext-enable +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -set -e - -extDir="$(php -d 'display_errors=stderr' -r 'echo ini_get("extension_dir");')" -cd "$extDir" - -usage() { - echo "usage: $0 [options] module-name [module-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 --ini-name 0-apc.ini apcu apc" - echo - echo 'Possible values for module-name:' - find -maxdepth 1 \ - -type f \ - -name '*.so' \ - -exec basename '{}' ';' \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -iniName= -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --ini-name) iniName="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -modules= -for module; do - if [ -z "$module" ]; then - continue - fi - if [ -f "$module.so" ] && ! [ -f "$module" ]; then - # allow ".so" to be optional - module="$module.so" - fi - if ! [ -f "$module" ]; then - echo >&2 "error: '$module' does not exist" - echo >&2 - usage >&2 - exit 1 - fi - modules="$modules $module" -done - -if [ -z "$modules" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual '.docker-php-ext-enable-deps' binutils - apkDel='.docker-php-ext-enable-deps' - fi -fi - -for module in $modules; do - if readelf --wide --syms "$module" | grep -q ' zend_extension_entry$'; then - # https://wiki.php.net/internals/extensions#loading_zend_extensions - absModule="$(readlink -f "$module")" - line="zend_extension=$absModule" - else - line="extension=$module" - fi - - ext="$(basename "$module")" - ext="${ext%.*}" - if php -d 'display_errors=stderr' -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then - # this isn't perfect, but it's better than nothing - # (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache') - echo >&2 - echo >&2 "warning: $ext ($module) is already loaded!" - echo >&2 - continue - fi - - ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}" - if ! grep -q "$line" "$ini" 2>/dev/null; then - echo "$line" >> "$ini" - fi -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi diff --git a/images/runtime/php/8.3/docker-php-ext-install b/images/runtime/php/8.3/docker-php-ext-install deleted file mode 100755 index 1afa66273b..0000000000 --- a/images/runtime/php/8.3/docker-php-ext-install +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 [-jN] ext-name [ext-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop" - echo - echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure' - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -j=1 -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --jobs|-j) j="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -exts= -for ext; do - if [ -z "$ext" ]; then - continue - fi - if [ ! -d "$ext" ]; then - echo >&2 "error: $PWD/$ext does not exist" - echo >&2 - usage >&2 - exit 1 - fi - exts="$exts $ext" -done - -if [ -z "$exts" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if [ -n "$PHPIZE_DEPS" ]; then - if apk info --installed .phpize-deps-configure > /dev/null; then - apkDel='.phpize-deps-configure' - elif ! apk info --installed .phpize-deps > /dev/null; then - apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS - apkDel='.phpize-deps' - fi - fi -fi - -popDir="$PWD" -for ext in $exts; do - cd "$ext" - [ -e Makefile ] || docker-php-ext-configure "$ext" - make -j"$j" - make -j"$j" install - find modules \ - -maxdepth 1 \ - -name '*.so' \ - -exec basename '{}' ';' \ - | xargs -r docker-php-ext-enable - make -j"$j" clean - cd "$popDir" -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi - -if [ -e /usr/src/php/.docker-delete-me ]; then - docker-php-source delete -fi diff --git a/images/runtime/php/8.3/docker-php-source b/images/runtime/php/8.3/docker-php-source deleted file mode 100755 index 9033d243de..0000000000 --- a/images/runtime/php/8.3/docker-php-source +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -dir=/usr/src/php - -usage() { - echo "usage: $0 COMMAND" - echo - echo "Manage php source tarball lifecycle." - echo - echo "Commands:" - echo " extract extract php source tarball into directory $dir if not already done." - echo " delete delete extracted php source located into $dir if not already done." - echo -} - -case "$1" in - extract) - mkdir -p "$dir" - if [ ! -f "$dir/.docker-extracted" ]; then - tar -Jxf /usr/src/php.tar.xz -C "$dir" --strip-components=1 - touch "$dir/.docker-extracted" - fi - ;; - - delete) - rm -rf "$dir" - ;; - - *) - usage - exit 1 - ;; -esac diff --git a/tests/Oryx.RuntimeImage.Tests/DotNetCore/DotNetCoreLibraryVerificationTest.cs b/tests/Oryx.RuntimeImage.Tests/DotNetCore/DotNetCoreLibraryVerificationTest.cs index d615e92dc4..63d40ca4c5 100644 --- a/tests/Oryx.RuntimeImage.Tests/DotNetCore/DotNetCoreLibraryVerificationTest.cs +++ b/tests/Oryx.RuntimeImage.Tests/DotNetCore/DotNetCoreLibraryVerificationTest.cs @@ -17,7 +17,6 @@ public DotNetCoreLibraryVerificationTest(ITestOutputHelper output) : base(output [Theory] [Trait("category", "runtime-bullseye")] - [InlineData("6.0")] [InlineData("8.0")] public void GDIPlusLibrary_IsPresentInTheBullseyeImage(string version) { @@ -73,7 +72,6 @@ public void GDIPlusLibrary_IsPresentInTheBookwormImage(string version) [Theory] [Trait("category", "runtime-bullseye")] - [InlineData("6.0")] [InlineData("8.0")] public void DotnetMonitorTool_IsPresentInTheBullseyeImage(string version) { diff --git a/tests/Oryx.RuntimeImage.Tests/DotNetCore/DotnetCoreImageVersionsTest.cs b/tests/Oryx.RuntimeImage.Tests/DotNetCore/DotnetCoreImageVersionsTest.cs index 83fae0051a..225c5eb28b 100644 --- a/tests/Oryx.RuntimeImage.Tests/DotNetCore/DotnetCoreImageVersionsTest.cs +++ b/tests/Oryx.RuntimeImage.Tests/DotNetCore/DotnetCoreImageVersionsTest.cs @@ -20,7 +20,6 @@ public DotNetCoreImageVersionsTest(ITestOutputHelper output) : base(output) [Theory] [Trait("category", "runtime-bullseye")] - [InlineData("6.0")] [InlineData("8.0")] public void DotNetCoreBullseyeRuntimeImage_Contains_VersionAndCommit_Information(string version) { @@ -98,7 +97,6 @@ public void DotNetCoreBookwormRuntimeImage_Contains_VersionAndCommit_Information [Theory] [Trait("category", "runtime-bullseye")] - [InlineData("6.0", "Version: " + DotNetCoreRunTimeVersions.NetCoreApp60)] [InlineData("8.0", "Version: " + DotNetCoreRunTimeVersions.NetCoreApp80)] [Trait(TestConstants.Category, TestConstants.Release)] public void RuntimeImage_Bullseye_HasExecptedDotNetVersion(string version, string expectedOutput) diff --git a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageCanRunWhenAppInsightsModuleNotFound.cs b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageCanRunWhenAppInsightsModuleNotFound.cs index 82dbc28c01..b7a970c1cf 100644 --- a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageCanRunWhenAppInsightsModuleNotFound.cs +++ b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageCanRunWhenAppInsightsModuleNotFound.cs @@ -21,57 +21,6 @@ public NodeRuntimeImageCanRunWhenAppInsightsModuleNotFound( { } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData( - // nameof(TestValueGenerator.GetBusterNodeVersions), - // MemberType = typeof(TestValueGenerator))] - // public async Task GeneratesScriptForBuster_CanRun_AppInsightsModule_NotFoundAsync(string nodeVersion, string osType) - // { - // // This test is for the following scenario: - // // When we find no application insight dependency in package.json, but env variables for - // // configuring application insights has been set in portal - - // // Arrange - // var appName = "linxnodeexpress"; - // var hostDir = Path.Combine(_hostSamplesDir, "nodejs", appName); - // var volume = DockerVolume.CreateMirror(hostDir); - // var appDir = volume.ContainerDir; - // var imageName = _imageHelper.GetRuntimeImage("node", nodeVersion, osType); - // var aiConnectionString - // = ExtVarNames.UserAppInsightsConnectionStringEnv; - // var aIEnabled = ExtVarNames.UserAppInsightsAgentExtensionVersion; - // int containerDebugPort = 8080; - - // var script = new ShellScriptBuilder() - // .AddCommand($"export {aiConnectionString}={TestConstants.AppInsightsConnectionString}") - // .AddCommand($"export {aIEnabled}=TRUE") - // .AddCommand($"cd {appDir}") - // .AddCommand("npm install") - // .AddCommand($"oryx create-script -appPath {appDir}") - // .AddDirectoryExistsCheck($"{appDir}/node_modules") - // .AddDirectoryDoesNotExistCheck($"{appDir}/node_modules/applicationinsights") - // .AddFileExistsCheck($"{FilePaths.NodeGlobalModulesPath}/{FilePaths.NodeAppInsightsLoaderFileName}") - // .AddCommand("./run.sh") - // .ToString(); - - // await EndToEndTestHelper.RunAndAssertAppAsync( - // imageName: _imageHelper.GetRuntimeImage("node", nodeVersion, osType), - // output: _output, - // volumes: new List { volume }, - // environmentVariables: null, - // port: containerDebugPort, - // link: null, - // runCmd: "/bin/sh", - // runArgs: new[] { "-c", script }, - // assertAction: async (hostPort) => - // { - // var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - // Assert.Contains("Hello World from express!", data); - // }, - // dockerCli: _dockerCli); - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData( @@ -174,54 +123,6 @@ await EndToEndTestHelper.RunAndAssertAppAsync( dockerCli: _dockerCli); } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData( - // nameof(TestValueGenerator.GetBusterNodeVersions), - // MemberType = typeof(TestValueGenerator))] - // public async Task GeneratesScriptForBuster_CanRun_With_AppInsights_Env_Variables_NotConfigured_Async(string nodeVersion, string osType) - // { - // // This test is for the following scenario: - // // When we find no application insight dependency in package.json and env variables for - // // configuring application insights has not been set properly in portal - - // // Arrange - // var appName = "linxnodeexpress"; - // var hostDir = Path.Combine(_hostSamplesDir, "nodejs", appName); - // var volume = DockerVolume.CreateMirror(hostDir); - // var appDir = volume.ContainerDir; - // var imageName = _imageHelper.GetRuntimeImage("node", nodeVersion, osType); - // var aIEnabled = ExtVarNames.UserAppInsightsAgentExtensionVersion; - // int containerDebugPort = 8080; - - // var script = new ShellScriptBuilder() - // .AddCommand($"export {aIEnabled}=disabled") - // .AddCommand($"cd {appDir}") - // .AddCommand("npm install") - // .AddCommand($"oryx create-script -appPath {appDir}") - // .AddDirectoryExistsCheck($"{appDir}/node_modules") - // .AddDirectoryDoesNotExistCheck($"{appDir}/node_modules/applicationinsights") - // .AddCommand("./run.sh") - // .AddFileDoesNotExistCheck($"{appDir}/oryx-appinsightsloader.js") - // .ToString(); - - // await EndToEndTestHelper.RunAndAssertAppAsync( - // imageName: _imageHelper.GetRuntimeImage("node", nodeVersion, osType), - // output: _output, - // volumes: new List { volume }, - // environmentVariables: null, - // port: containerDebugPort, - // link: null, - // runCmd: "/bin/sh", - // runArgs: new[] { "-c", script }, - // assertAction: async (hostPort) => - // { - // var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - // Assert.Contains("Hello World from express!", data); - // }, - // dockerCli: _dockerCli); - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData( @@ -318,58 +219,6 @@ await EndToEndTestHelper.RunAndAssertAppAsync( dockerCli: _dockerCli); } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData( - // nameof(TestValueGenerator.GetBusterNodeVersions), - // MemberType = typeof(TestValueGenerator))] - // public async Task GeneratesScriptForBuster_CanRun_With_New_AppInsights_Env_Variable_Set_Async(string nodeVersion, string osType) - // { - // // This test is for the following scenario: - // // When we find the user has set env variable "APPLICATIONINSIGHTS_CONNECTION_STRING" application insight dependency in package.json and env variables for - // // configuring application insights has not been set properly in portal - - // // Arrange - // var appName = "linxnodeexpress"; - // var hostDir = Path.Combine(_hostSamplesDir, "nodejs", appName); - // var volume = DockerVolume.CreateMirror(hostDir); - // var appDir = volume.ContainerDir; - // var imageName = _imageHelper.GetRuntimeImage("node", nodeVersion, osType); - // var aIEnabled = ExtVarNames.UserAppInsightsAgentExtensionVersion; - // var connectionStringEnv = ExtVarNames.UserAppInsightsConnectionStringEnv; - // int containerDebugPort = 8080; - // var AppInsightsStartUpLegacyPayLoadMessage = "Application Insights was started with setupString"; - - // var script = new ShellScriptBuilder() - // .AddCommand($"export {aIEnabled}=Enabled") - // .AddCommand($"export {connectionStringEnv}=alkajsldkajd") - // .AddCommand($"cd {appDir}") - // .AddCommand("npm install") - // .AddCommand($"oryx create-script -appPath {appDir}") - // .AddDirectoryExistsCheck($"{appDir}/node_modules") - // .AddDirectoryDoesNotExistCheck($"{appDir}/node_modules/applicationinsights") - // .AddCommand($"./run.sh > {appDir}/log.log") - // .AddFileDoesNotExistCheck($"{appDir}/oryx-appinsightsloader.js") - // .AddStringDoesNotExistInFileCheck(AppInsightsStartUpLegacyPayLoadMessage, $"{appDir}/log.log") - // .ToString(); - - // await EndToEndTestHelper.RunAndAssertAppAsync( - // imageName: _imageHelper.GetRuntimeImage("node", nodeVersion, osType), - // output: _output, - // volumes: new List { volume }, - // environmentVariables: null, - // port: containerDebugPort, - // link: null, - // runCmd: "/bin/sh", - // runArgs: new[] { "-c", script }, - // assertAction: async (hostPort) => - // { - // var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - // Assert.Contains("Hello World from express!", data); - // }, - // dockerCli: _dockerCli); - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData( @@ -474,58 +323,6 @@ await EndToEndTestHelper.RunAndAssertAppAsync( dockerCli: _dockerCli); } - // [Theory] - // [Trait("category", "runtime-buster")] - // [InlineData("14", "")] - // [InlineData("14", "disabled")] - // public async Task GeneratesScriptForBuster_Doesnot_Add_Oryx_AppInsights_Logic_With_IPA_Configuration_Async( - // string nodeVersion, - // string agentExtensionVersionEnvValue) - // { - // // This test is for the following scenario: - // // When we find the user has set env variable "ApplicationInsightsAgent_EXTENSION_VERSION" to '~3' - // // Oryx should not attach appinsight codeless config to runscript - - // // Arrange - // var appName = "linxnodeexpress-appinsights"; - // var hostDir = Path.Combine(_hostSamplesDir, "nodejs", appName); - // var volume = DockerVolume.CreateMirror(hostDir); - // var appDir = volume.ContainerDir; - // var imageName = _imageHelper.GetRuntimeImage("node", nodeVersion, ImageTestHelperConstants.OsTypeDebianBuster); - // //agentextension version will be set to '~3' or '' or 'disabled' - // var agentExtensionVersionEnv = ExtVarNames.UserAppInsightsAgentExtensionVersion; - // var connectionStringEnv = ExtVarNames.UserAppInsightsConnectionStringEnv; - // int containerDebugPort = 8080; - // var OryxAppInsightsAttachString = "--require /usr/local/lib/node_modules/applicationinsights/out/Bootstrap/Oryx.js"; - - // var script = new ShellScriptBuilder() - // .AddCommand($"export {agentExtensionVersionEnv}={agentExtensionVersionEnvValue}") - // .AddCommand($"export {connectionStringEnv}=alkajsldkajd") - // .AddCommand($"cd {appDir}") - // .AddCommand("npm install") - // .AddCommand($"oryx create-script -appPath {appDir}") - // .AddDirectoryExistsCheck($"{appDir}/node_modules") - // .AddCommand($"./run.sh > {appDir}/log.log") - // .AddStringDoesNotExistInFileCheck(OryxAppInsightsAttachString, $"{appDir}/run.sh") - // .ToString(); - - // await EndToEndTestHelper.RunAndAssertAppAsync( - // imageName: _imageHelper.GetRuntimeImage("node", nodeVersion, ImageTestHelperConstants.OsTypeDebianBuster), - // output: _output, - // volumes: new List { volume }, - // environmentVariables: null, - // port: containerDebugPort, - // link: null, - // runCmd: "/bin/sh", - // runArgs: new[] { "-c", script }, - // assertAction: async (hostPort) => - // { - // var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - // Assert.Contains("AppInsights is not configured!", data); - // }, - // dockerCli: _dockerCli); - // } - // [Theory] // [Trait("category", "runtime-bullseye")] // [InlineData("14", "")] diff --git a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageContainsRequiredPrograms.cs b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageContainsRequiredPrograms.cs index a2ceb672ca..26cd0d3b05 100644 --- a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageContainsRequiredPrograms.cs +++ b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageContainsRequiredPrograms.cs @@ -18,27 +18,6 @@ public NodeRuntimeImageContainsRequiredPrograms( { } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData(nameof(TestValueGenerator.GetBusterNodeVersions), MemberType = typeof(TestValueGenerator))] - // public void NodeBusterImage_Contains_RequiredPrograms(string version, string osType) - // { - // // Arrange & Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("node", version, osType), - // CommandToExecuteOnRun = "/bin/sh", - // CommandArguments = new[] - // { - // "-c", - // "which tar && which unzip && which pm2 && cd /opt/node-wrapper && node --version" - // } - // }); - - // // Assert - // RunAsserts(() => Assert.True(result.IsSuccess), result.GetDebugInfo()); - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData(nameof(TestValueGenerator.GetBullseyeNodeVersions), MemberType = typeof(TestValueGenerator))] @@ -81,79 +60,6 @@ public void NodeBookwormImage_Contains_RequiredPrograms(string version, string o RunAsserts(() => Assert.True(result.IsSuccess), result.GetDebugInfo()); } - // [Theory] - // [Trait("category", "runtime-buster")] - // [InlineData("14")] - // public void Node14BusterImage_Contains_PM2(string version) - // { - // // Arrange & Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("node", version, ImageTestHelperConstants.OsTypeDebianBuster), - // CommandToExecuteOnRun = "/bin/sh", - // CommandArguments = new[] - // { - // "-c", - // "which pm2" - // } - // }); - - // // Assert - // RunAsserts(() => Assert.True(result.IsSuccess), result.GetDebugInfo()); - // } - - // [Theory] - // [Trait("category", "runtime-bullseye")] - // [InlineData("14")] - // public void Node14BullseyeImage_Contains_PM2(string version) - // { - // // Arrange & Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("node", version, ImageTestHelperConstants.OsTypeDebianBullseye), - // CommandToExecuteOnRun = "/bin/sh", - // CommandArguments = new[] - // { - // "-c", - // "which pm2" - // } - // }); - - // // Assert - // RunAsserts(() => Assert.True(result.IsSuccess), result.GetDebugInfo()); - // } - - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData(nameof(TestValueGenerator.GetBusterNodeVersions), MemberType = typeof(TestValueGenerator))] - // public void NodeBusterImage_Contains_ApplicationInsights(string version, string osType) - // { - // // Arrange & Act - // var expectedAppInsightsVersion = string.Concat("applicationinsights@", NodeVersions.NodeAppInsightsSdkVersion); - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("node", version, osType), - // CommandToExecuteOnRun = "/bin/sh", - // CommandArguments = new[] - // { - // "-c", - // "npm list -g applicationinsights" - // } - // }); - - // var actualOutput = result.StdOut.ReplaceNewLine(); - - // // Assert - // RunAsserts( - // () => - // { - // Assert.True(result.IsSuccess); - // Assert.Contains(expectedAppInsightsVersion, actualOutput); - // Assert.Contains("/usr/local/lib", actualOutput); - // }, - // result.GetDebugInfo()); - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData(nameof(TestValueGenerator.GetBullseyeNodeVersions), MemberType = typeof(TestValueGenerator))] @@ -216,33 +122,6 @@ public void NodeBookwormImage_Contains_ApplicationInsights(string version, strin result.GetDebugInfo()); } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData(nameof(TestValueGenerator.GetBusterNodeVersions), MemberType = typeof(TestValueGenerator))] - // public void NodeBusterImages_Contains_Correct_NPM_Version(string version, string osType) - // { - // // Arrange & Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("node", version, osType), - // CommandToExecuteOnRun = "/bin/sh", - // CommandArguments = new[] - // { - // "-c", - // "npm -v" - // } - // }); - - // // Assert - // RunAsserts( - // () => - // { - // Assert.True(result.IsSuccess); - // Assert.Contains(NodeVersions.NpmVersion, result.StdOut.ReplaceNewLine()); - // }, - // result.GetDebugInfo()); - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData(nameof(TestValueGenerator.GetBullseyeNodeVersions), MemberType = typeof(TestValueGenerator))] diff --git a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageContainsVersionAndCommitInfo.cs b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageContainsVersionAndCommitInfo.cs index 05549c6314..ec72e70a59 100644 --- a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageContainsVersionAndCommitInfo.cs +++ b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageContainsVersionAndCommitInfo.cs @@ -18,43 +18,6 @@ public NodeRuntimeImageContainsVersionAndCommitInfo( { } - // [SkippableTheory] - // [Trait("category", "runtime-buster")] - // [MemberData(nameof(TestValueGenerator.GetBusterNodeVersions), MemberType = typeof(TestValueGenerator))] - // public void NodeBusterImage_Contains_VersionAndCommit_Information(string version, string osType) - // { - // // We can't always rely on git commit ID as env variable in case build context is not correctly passed - // // so we should check agent_os environment variable to know if the build is happening in azure devops agent - // // or locally, locally we need to skip this test - // var agentOS = Environment.GetEnvironmentVariable("AGENT_OS"); - // Skip.If(string.IsNullOrEmpty(agentOS)); - - // // Arrange - // var gitCommitID = GitHelper.GetCommitID(); - // var buildNumber = Environment.GetEnvironmentVariable("IMAGE_BUILDNUMBER"); - // var expectedOryxVersion = string.Concat(Settings.OryxVersion, buildNumber); - - // // Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("node", version, osType), - // CommandToExecuteOnRun = "oryx", - // CommandArguments = new[] { "version" } - // }); - - // // Assert - // RunAsserts( - // () => - // { - // Assert.True(result.IsSuccess); - // Assert.NotNull(result.StdErr); - // Assert.DoesNotContain(".unspecified, Commit: unspecified", result.StdOut); - // Assert.Contains(gitCommitID, result.StdOut); - // Assert.Contains(expectedOryxVersion, result.StdOut); - // }, - // result.GetDebugInfo()); - // } - [SkippableTheory] [Trait("category", "runtime-bullseye")] [MemberData(nameof(TestValueGenerator.GetBullseyeNodeVersions), MemberType = typeof(TestValueGenerator))] diff --git a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageOtherTests.cs b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageOtherTests.cs index 6219416a77..c9c58de742 100644 --- a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageOtherTests.cs +++ b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageOtherTests.cs @@ -163,36 +163,6 @@ public void HasExpected_Global_Bullseye_Node_Module_Path(string nodeVersion, str result.GetDebugInfo()); } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData( - // nameof(TestValueGenerator.GetBusterNodeVersions), - // MemberType = typeof(TestValueGenerator))] - // public void HasExpected_Global_Buster_Node_Module_Path(string nodeVersion, string osType) - // { - // // Arrange & Act - // var script = new ShellScriptBuilder() - // .AddCommand("npm root --quiet -g") - // .ToString(); - - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("node", nodeVersion, osType), - // CommandToExecuteOnRun = "/bin/bash", - // CommandArguments = new[] { "-c", script } - // }); - - // // Assert - // var actualOutput = result.StdOut.ReplaceNewLine(); - // RunAsserts( - // () => - // { - // Assert.True(result.IsSuccess); - // Assert.Contains(FilePaths.NodeGlobalModulesPath, actualOutput); - // }, - // result.GetDebugInfo()); - // } - [Fact] [Trait("category", "runtime-bullseye")] @@ -220,45 +190,6 @@ public void GeneratedScript_CanRunStartupScriptsFromAppRoot() RunAsserts(() => Assert.Equal(exitCodeSentinel, result.ExitCode), result.GetDebugInfo()); } - // [Theory(Skip = "Investigating debugging using pm2")] - // [Trait("category", "runtime-buster")] - // [MemberData( - // nameof(TestValueGenerator.GetBusterNodeVersions_SupportDebugging), - // MemberType = typeof(TestValueGenerator))] - // public async Task RunBusterNodeAppUsingProcessJson_withDebuggingAsync(string nodeVersion, string osType) - // { - // var appName = "express-process-json"; - // var hostDir = Path.Combine(_hostSamplesDir, "nodejs", appName); - // var volume = DockerVolume.CreateMirror(hostDir); - // var dir = volume.ContainerDir; - // int containerDebugPort = 8080; - - // var runAppScript = new ShellScriptBuilder() - // .AddCommand($"cd {dir}/app") - // .AddCommand("npm install") - // .AddCommand("cd ..") - // .AddCommand($"oryx create-script -remoteDebug -debugPort={containerDebugPort}") - // .AddCommand("./run.sh") - // .ToString(); - - // await EndToEndTestHelper.RunAndAssertAppAsync( - // imageName: _imageHelper.GetRuntimeImage("node", nodeVersion, osType), - // output: _output, - // volumes: new List { volume }, - // environmentVariables: null, - // port: containerDebugPort, - // link: null, - // runCmd: "/bin/sh", - // runArgs: new[] { "-c", runAppScript }, - // assertAction: async (hostPort) => - // { - // var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - // Assert.Contains("Say It Again", data); - // }, - // dockerCli: _dockerCli); - - // } - [Theory(Skip = "Investigating debugging using pm2")] [Trait("category", "runtime-bullseye")] [MemberData( diff --git a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingConfigJs.cs b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingConfigJs.cs index d9705ddb68..d9e57a260d 100644 --- a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingConfigJs.cs +++ b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingConfigJs.cs @@ -21,44 +21,6 @@ public NodeRuntimeImageRunAppUsingConfigJs( { } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData(nameof(TestValueGenerator.GetBusterNodeVersions_SupportPm2), MemberType = typeof(TestValueGenerator))] - // public async Task RunBusterNodeAppUsingConfigJsAsync(string nodeVersion, string osType) - // { - - // var appName = "express-config-js"; - // var hostDir = Path.Combine(_hostSamplesDir, "nodejs", appName); - // var volume = DockerVolume.CreateMirror(hostDir); - // var dir = volume.ContainerDir; - // int containerPort = 80; - - // var runAppScript = new ShellScriptBuilder() - // .AddCommand($"cd {dir}/app") - // .AddCommand("npm install") - // .AddCommand("cd ..") - // .AddCommand($"oryx create-script -bindPort {containerPort} -usePM2") - // .AddCommand("./run.sh") - // .ToString(); - - // await EndToEndTestHelper.RunAndAssertAppAsync( - // imageName: _imageHelper.GetRuntimeImage("node", nodeVersion, osType), - // output: _output, - // volumes: new List { volume }, - // environmentVariables: null, - // containerPort, - // link: null, - // runCmd: "/bin/sh", - // runArgs: new[] { "-c", runAppScript }, - // assertAction: async (hostPort) => - // { - // var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - // Assert.Equal("Hello World from express!", data); - // }, - // dockerCli: _dockerCli); - - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData(nameof(TestValueGenerator.GetBullseyeNodeVersions_SupportPm2), MemberType = typeof(TestValueGenerator))] diff --git a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingConfigYml.cs b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingConfigYml.cs index 9063452092..463829941d 100644 --- a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingConfigYml.cs +++ b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingConfigYml.cs @@ -21,43 +21,6 @@ public NodeRuntimeImageRunAppUsingConfigYml( { } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData(nameof(TestValueGenerator.GetBusterNodeVersions_SupportPm2), MemberType = typeof(TestValueGenerator))] - // public async Task RunBusterNodeAppUsingConfigYmlAsync(string nodeVersion, string osType) - // { - - // var appName = "express-config-yaml"; - // var hostDir = Path.Combine(_hostSamplesDir, "nodejs", appName); - // var volume = DockerVolume.CreateMirror(hostDir); - // var dir = volume.ContainerDir; - // int containerPort = 80; - - // var runAppScript = new ShellScriptBuilder() - // .AddCommand($"cd {dir}/app") - // .AddCommand("npm install") - // .AddCommand("cd ..") - // .AddCommand($"oryx create-script -bindPort {containerPort} -userStartupCommand config.yml -usePM2") - // .AddCommand("./run.sh") - // .ToString(); - - // await EndToEndTestHelper.RunAndAssertAppAsync( - // imageName: _imageHelper.GetRuntimeImage("node", nodeVersion, osType), - // output: _output, - // volumes: new List { volume }, - // environmentVariables: null, - // containerPort, - // link: null, - // runCmd: "/bin/sh", - // runArgs: new[] { "-c", runAppScript }, - // assertAction: async (hostPort) => - // { - // var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - // Assert.Equal("Hello World from express!", data); - // }, - // dockerCli: _dockerCli); - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData(nameof(TestValueGenerator.GetBullseyeNodeVersions_SupportPm2), MemberType = typeof(TestValueGenerator))] diff --git a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingProcessJson.cs b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingProcessJson.cs index 5762f5f966..e7313c0fab 100644 --- a/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingProcessJson.cs +++ b/tests/Oryx.RuntimeImage.Tests/Node/NodeRuntimeImageRunAppUsingProcessJson.cs @@ -21,44 +21,6 @@ public NodeRuntimeImageRunAppUsingProcessJson( { } - // [Theory] - // [Trait("category", "runtime-buster")] - // [MemberData(nameof(TestValueGenerator.GetBusterNodeVersions_SupportPm2), MemberType = typeof(TestValueGenerator))] - // public async Task RunBusterNodeAppUsingProcessJson(string nodeVersion, string osType) - // { - - // var appName = "express-process-json"; - // var hostDir = Path.Combine(_hostSamplesDir, "nodejs", appName); - // var volume = DockerVolume.CreateMirror(hostDir); - // var dir = volume.ContainerDir; - // int containerPort = 80; - - // var runAppScript = new ShellScriptBuilder() - // .AddCommand($"cd {dir}/app") - // .AddCommand("npm install") - // .AddCommand("cd ..") - // .AddCommand($"oryx create-script -bindPort {containerPort} -usePM2") - // .AddCommand("./run.sh") - // .ToString(); - - // await EndToEndTestHelper.RunAndAssertAppAsync( - // imageName: _imageHelper.GetRuntimeImage("node", nodeVersion, osType), - // output: _output, - // volumes: new List { volume }, - // environmentVariables: null, - // containerPort, - // link: null, - // runCmd: "/bin/sh", - // runArgs: new[] { "-c", runAppScript }, - // assertAction: async (hostPort) => - // { - // var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - // Assert.Equal("Hello World from express!", data); - // }, - // dockerCli: _dockerCli); - - // } - [Theory] [Trait("category", "runtime-bullseye")] [MemberData(nameof(TestValueGenerator.GetBullseyeNodeVersions_SupportPm2), MemberType = typeof(TestValueGenerator))] diff --git a/tests/Oryx.RuntimeImage.Tests/Php-fpm/PhpFpmImageTest.cs b/tests/Oryx.RuntimeImage.Tests/Php-fpm/PhpFpmImageTest.cs index 887875c991..09459907de 100644 --- a/tests/Oryx.RuntimeImage.Tests/Php-fpm/PhpFpmImageTest.cs +++ b/tests/Oryx.RuntimeImage.Tests/Php-fpm/PhpFpmImageTest.cs @@ -54,8 +54,6 @@ public PhpFpmImageTest(ITestOutputHelper output, TestTempDirTestFixture testTemp [Theory] [Trait("category", "runtime-bullseye")] - // [InlineData("7.4-fpm", PhpVersions.Php74Version)] - // [InlineData("8.0-fpm", PhpVersions.Php80Version)] [InlineData("8.1-fpm", PhpVersions.Php81Version)] [InlineData("8.2-fpm", PhpVersions.Php82Version)] [InlineData("8.3-fpm", PhpVersions.Php83Version)] @@ -104,8 +102,6 @@ public void VersionMatchesBookwormImageName(string version, string expectedPhpVe [Theory] [Trait("category", "runtime-bullseye")] - // [InlineData("7.4-fpm")] - // [InlineData("8.0-fpm")] [InlineData("8.1-fpm")] [InlineData("8.2-fpm")] [InlineData("8.3-fpm")] @@ -200,8 +196,6 @@ public void GraphicsExtension_Gd_IsInstalled_For_Bookworm(string version) [SkippableTheory] [Trait("category", "runtime-bullseye")] - // [InlineData("7.4-fpm")] - // [InlineData("8.0-fpm")] [InlineData("8.1-fpm")] [InlineData("8.2-fpm")] [InlineData("8.3-fpm")] @@ -280,8 +274,6 @@ public void PhpFpmBookwormRuntimeImage_Contains_VersionAndCommit_Information(str [Theory] [Trait("category", "runtime-bullseye")] - // [InlineData("7.4-fpm")] - // [InlineData("8.0-fpm")] [InlineData("8.1-fpm")] [InlineData("8.2-fpm")] [InlineData("8.3-fpm")] diff --git a/tests/Oryx.RuntimeImage.Tests/Python/PythonImagesTests.cs b/tests/Oryx.RuntimeImage.Tests/Python/PythonImagesTests.cs index 50fdd215b5..1b665b0fca 100644 --- a/tests/Oryx.RuntimeImage.Tests/Python/PythonImagesTests.cs +++ b/tests/Oryx.RuntimeImage.Tests/Python/PythonImagesTests.cs @@ -20,7 +20,6 @@ public PythonImagesTest(ITestOutputHelper output) : base(output) [Theory] [Trait("category", "runtime-buster")] - [InlineData("3.8")] [InlineData("3.9")] public void PythonBusterRuntimeImage_Contains_VersionAndCommit_Information(string version) { @@ -58,7 +57,6 @@ public void PythonBusterRuntimeImage_Contains_VersionAndCommit_Information(strin [Theory] [Trait("category", "runtime-bullseye")] - [InlineData("3.8")] [InlineData("3.9")] [InlineData("3.10")] [InlineData("3.11")] @@ -139,7 +137,6 @@ public void PythonBookwormRuntimeImage_Contains_VersionAndCommit_Information(str [Theory] [Trait("category", "runtime-buster")] - [InlineData("3.8")] [InlineData("3.9")] public void JamSpell_CanBe_InstalledInBusterRunTimeImage(string version) { @@ -166,7 +163,6 @@ public void JamSpell_CanBe_InstalledInBusterRunTimeImage(string version) [Theory] [Trait("category", "runtime-bullseye")] - [InlineData("3.8")] [InlineData("3.9")] [InlineData("3.10")] [InlineData("3.11")] @@ -252,7 +248,6 @@ public void PythonVersionMatchesBookwormImageName(string pythonVersion, string e [Theory] [Trait("category", "runtime-bullseye")] - [InlineData("3.8", "Python " + PythonVersions.Python38Version)] [InlineData("3.9", "Python " + PythonVersions.Python39Version)] [InlineData("3.10", "Python " + PythonVersions.Python310Version)] [InlineData("3.11", "Python " + PythonVersions.Python311Version)] @@ -282,7 +277,6 @@ public void PythonVersionMatchesBullseyeImageName(string pythonVersion, string e [Theory] [Trait("category", "runtime-buster")] - [InlineData("3.8", "Python " + PythonVersions.Python38Version)] [InlineData("3.9", "Python " + PythonVersions.Python39Version)] [Trait(TestConstants.Category, TestConstants.Release)] public void PythonVersionMatchesBusterImageName(string pythonVersion, string expectedOutput) diff --git a/tests/Oryx.RuntimeImage.Tests/Ruby/RubyImagesTest.cs b/tests/Oryx.RuntimeImage.Tests/Ruby/RubyImagesTest.cs deleted file mode 100644 index e60a99140d..0000000000 --- a/tests/Oryx.RuntimeImage.Tests/Ruby/RubyImagesTest.cs +++ /dev/null @@ -1,137 +0,0 @@ -// -------------------------------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. -// -------------------------------------------------------------------------------------------- - -using System; -using System.Linq; -using Microsoft.Oryx.BuildScriptGenerator.Common; -using Microsoft.Oryx.Tests.Common; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.Oryx.RuntimeImage.Tests -{ - public class RubyImagesTest : TestBase - { - public RubyImagesTest(ITestOutputHelper output) : base(output) - { - } - - // [SkippableFact] - // [Trait("category", "runtime-buster")] - // public void RubyRuntimeImage_Contains_VersionAndCommit_Information() - // { - // // we cant always rely on gitcommitid as env variable in case build context is not correctly passed - // // so we should check agent_os environment variable to know if the build is happening in azure devops agent - // // or locally, locally we need to skip this test - // var agentOS = Environment.GetEnvironmentVariable("AGENT_OS"); - // Skip.If(string.IsNullOrEmpty(agentOS)); - - // // Arrange - // var gitCommitID = GitHelper.GetCommitID(); - // var buildNumber = Environment.GetEnvironmentVariable("IMAGE_BUILDNUMBER"); - // var expectedOryxVersion = string.Concat(Settings.OryxVersion, buildNumber); - - // // Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("ruby", "dynamic", ImageTestHelperConstants.OsTypeDebianBuster), - // CommandToExecuteOnRun = "oryx", - // CommandArguments = new[] { "version" } - // }); - - // // Assert - // RunAsserts( - // () => - // { - // Assert.True(result.IsSuccess); - // Assert.NotNull(result.StdErr); - // Assert.DoesNotContain(".unspecified, Commit: unspecified", result.StdOut); - // Assert.Contains(gitCommitID, result.StdOut); - // Assert.Contains(expectedOryxVersion, result.StdOut); - // }, - // result.GetDebugInfo()); - // } - - // [Fact] - // [Trait("category", "runtime-buster")] - // public void GeneratedScript_CanRunStartupScriptsFromAppRoot() - // { - // // Arrange - // const int exitCodeSentinel = 222; - // var appPath = "/tmp/app"; - // var script = new ShellScriptBuilder() - // .CreateDirectory(appPath) - // .CreateFile(appPath + "/entry.sh", $"exit {exitCodeSentinel}") - // .AddCommand("oryx create-script -userStartupCommand entry.sh -appPath " + appPath) - // .AddCommand(". ./run.sh") // Source the default output path - // .ToString(); - - // // Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("ruby", "dynamic", ImageTestHelperConstants.OsTypeDebianBuster), - // CommandToExecuteOnRun = "/bin/sh", - // CommandArguments = new[] { "-c", script } - // }); - - // // Assert - // RunAsserts(() => Assert.Equal(exitCodeSentinel, result.ExitCode), result.GetDebugInfo()); - // } - - // [Theory] - // [Trait("category", "runtime-buster")] - // [InlineData("2.5", "ruby " + RubyVersions.Ruby25Version)] - // [InlineData("2.6", "ruby " + RubyVersions.Ruby26Version)] - // [InlineData("2.7", "ruby " + RubyVersions.Ruby27Version)] - // [Trait(TestConstants.Category, TestConstants.Release)] - // public void RubyVersionMatchesBusterImageName(string rubyVersion, string expectedOutput) - // { - // // Arrange & Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("ruby", rubyVersion, ImageTestHelperConstants.OsTypeDebianBuster), - // CommandToExecuteOnRun = "ruby", - // CommandArguments = new[] { "--version" } - // }); - - // // Assert - // var actualOutput = result.StdOut.ReplaceNewLine(); - // RunAsserts( - // () => - // { - // Assert.True(result.IsSuccess); - // Assert.Contains(expectedOutput, actualOutput); - // }, - // result.GetDebugInfo()); - // } - - // [Theory] - // [Trait("category", "runtime-bullseye")] - // [InlineData("2.5", "ruby " + RubyVersions.Ruby25Version)] - // [InlineData("2.6", "ruby " + RubyVersions.Ruby26Version)] - // [InlineData("2.7", "ruby " + RubyVersions.Ruby27Version)] - // [Trait(TestConstants.Category, TestConstants.Release)] - // public void RubyVersionMatchesBullseyeImageName(string rubyVersion, string expectedOutput) - // { - // // Arrange & Act - // var result = _dockerCli.Run(new DockerRunArguments - // { - // ImageId = _imageHelper.GetRuntimeImage("ruby", rubyVersion, ImageTestHelperConstants.OsTypeDebianBullseye), - // CommandToExecuteOnRun = "ruby", - // CommandArguments = new[] { "--version" } - // }); - - // // Assert - // var actualOutput = result.StdOut.ReplaceNewLine(); - // RunAsserts( - // () => - // { - // Assert.True(result.IsSuccess); - // Assert.Contains(expectedOutput, actualOutput); - // }, - // result.GetDebugInfo()); - // } - } -} \ No newline at end of file