From c13e15630360fa994260e89c7eeac18bac1a044a Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Wed, 1 Feb 2023 15:31:34 +0100 Subject: [PATCH 01/25] Dropped PHP 7.4 --- .github/scripts/docker-tags.sh | 2 +- .github/workflows/default.yaml | 17 - 7.4/.dockerignore | 4 - 7.4/Dockerfile | 542 ------------------ 7.4/Makefile | 76 --- 7.4/config/.ssh/config | 5 - 7.4/config/.ssh/id_rsa.tmpl | 1 - 7.4/config/.terminus/config.yml | 2 - 7.4/config/code-server/User/settings.json | 37 -- 7.4/config/code-server/config.yaml.tmpl | 9 - 7.4/config/php/opcache.ini | 3 - 7.4/config/php/xdebug.ini | 12 - 7.4/config/php/xhprof.ini | 2 - 7.4/config/php/zz-php-fpm.conf | 19 - 7.4/config/php/zz-php.ini | 19 - .../supervisord-code-server.conf.tmpl | 6 - 7.4/config/supervisor/supervisord-crond.conf | 5 - .../supervisor/supervisord-php-fpm.conf | 4 - 7.4/config/supervisor/supervisord-sshd.conf | 4 - 7.4/config/supervisor/supervisord.conf | 6 - 7.4/healthcheck.sh | 16 - 7.4/ping-web.sh | 11 - 7.4/startup.sh | 238 -------- 7.4/tests/essential-binaries.sh | 81 --- 7.4/tests/php-modules.sh | 149 ----- README.md | 9 +- tests/test.bats | 5 - 27 files changed, 5 insertions(+), 1279 deletions(-) delete mode 100644 7.4/.dockerignore delete mode 100644 7.4/Dockerfile delete mode 100644 7.4/Makefile delete mode 100644 7.4/config/.ssh/config delete mode 100644 7.4/config/.ssh/id_rsa.tmpl delete mode 100644 7.4/config/.terminus/config.yml delete mode 100644 7.4/config/code-server/User/settings.json delete mode 100644 7.4/config/code-server/config.yaml.tmpl delete mode 100644 7.4/config/php/opcache.ini delete mode 100644 7.4/config/php/xdebug.ini delete mode 100644 7.4/config/php/xhprof.ini delete mode 100644 7.4/config/php/zz-php-fpm.conf delete mode 100644 7.4/config/php/zz-php.ini delete mode 100644 7.4/config/supervisor/supervisord-code-server.conf.tmpl delete mode 100644 7.4/config/supervisor/supervisord-crond.conf delete mode 100644 7.4/config/supervisor/supervisord-php-fpm.conf delete mode 100644 7.4/config/supervisor/supervisord-sshd.conf delete mode 100644 7.4/config/supervisor/supervisord.conf delete mode 100755 7.4/healthcheck.sh delete mode 100755 7.4/ping-web.sh delete mode 100755 7.4/startup.sh delete mode 100755 7.4/tests/essential-binaries.sh delete mode 100755 7.4/tests/php-modules.sh diff --git a/.github/scripts/docker-tags.sh b/.github/scripts/docker-tags.sh index a9a2d2b9..9631c143 100755 --- a/.github/scripts/docker-tags.sh +++ b/.github/scripts/docker-tags.sh @@ -9,7 +9,7 @@ # Declare expected variables IMAGE=${IMAGE} # docksal/cli VERSION_PREFIX=${VERSION_PREFIX} # php -VERSION=${VERSION} # 7.4 +VERSION=${VERSION} # 8.1 VERSION_SUFFIX=${VERSION_SUFFIX} # ide REGISTRY="${REGISTRY}" # ghcr.io GITHUB_REF=${GITHUB_REF} # refs/heads/develop, refs/heads/master, refs/tags/v1.0.0 diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index a9b41964..fc1f21cd 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -31,10 +31,6 @@ jobs: fail-fast: false # Don't cancel other jobs if one fails matrix: include: - - - platform: linux/amd64 - arch: amd64 - version: '7.4' - platform: linux/amd64 arch: amd64 @@ -43,10 +39,6 @@ jobs: platform: linux/amd64 arch: amd64 version: '8.1' - - - platform: linux/arm64 - arch: arm64 - version: '7.4' - platform: linux/arm64 arch: arm64 @@ -120,10 +112,6 @@ jobs: fail-fast: false # Don't cancel other jobs if one fails matrix: include: - - - platform: linux/amd64 - arch: amd64 - version: '7.4' - platform: linux/amd64 arch: amd64 @@ -132,10 +120,6 @@ jobs: platform: linux/amd64 arch: amd64 version: '8.1' - - - platform: linux/arm64 - arch: arm64 - version: '7.4' - platform: linux/arm64 arch: arm64 @@ -217,7 +201,6 @@ jobs: strategy: matrix: version: - - '7.4' - '8.0' - '8.1' diff --git a/7.4/.dockerignore b/7.4/.dockerignore deleted file mode 100644 index 0123c988..00000000 --- a/7.4/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -tests -.dockerignore -Dockerfile -Makefile diff --git a/7.4/Dockerfile b/7.4/Dockerfile deleted file mode 100644 index 9157326c..00000000 --- a/7.4/Dockerfile +++ /dev/null @@ -1,542 +0,0 @@ -FROM php:7.4.33-fpm-bullseye as cli - -ARG TARGETARCH -ARG DEBIAN_FRONTEND=noninteractive -ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 - -# Prevent services autoload (http://jpetazzo.github.io/2013/10/06/policy-rc-d-do-not-start-services-automatically/) -RUN set -xe; \ - echo '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d - -# Install basic packages -RUN set -xe; \ - apt-get update >/dev/null; \ - apt-get -y --no-install-recommends install >/dev/null \ - apt-transport-https \ - # ca-certificates and curl come from upstream - #ca-certificates \ - #curl \ - gnupg \ - locales \ - wget \ - ;\ - # Cleanup - apt-get clean; rm -rf /var/lib/apt/lists/* - -# Set en_US.UTF-8 as the default locale -RUN set -xe; \ - localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 -ENV LC_ALL en_US.utf8 - -# Enable additional repos -RUN set -xe; \ - sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; \ - # blackfire.io repo - curl -fsSL https://packages.blackfire.io/gpg.key | apt-key add -; \ - echo "deb https://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list; \ - # git-lfs repo - curl -fsSL https://packagecloud.io/github/git-lfs/gpgkey | apt-key add -; \ - echo 'deb https://packagecloud.io/github/git-lfs/debian bullseye main' | tee /etc/apt/sources.list.d/github_git-lfs.list; - -# Additional packages -RUN set -xe; \ - # Create man direcotries, otherwise some packages may not install (e.g. postgresql-client) - # This should be a temporary workaround until fixed upstream: https://github.com/debuerreotype/debuerreotype/issues/10 - mkdir -p /usr/share/man/man1 /usr/share/man/man7; \ - apt-get update >/dev/null; \ - apt-get -y --no-install-recommends install >/dev/null \ - cron \ - dnsutils \ - git \ - git-lfs \ - ghostscript \ - # html2text binary - used for self-testing (php-fpm) - html2text \ - imagemagick \ - iputils-ping \ - less \ - # cgi-fcgi binary - used for self-testing (php-fpm) - libfcgi-bin \ - mc \ - msmtp \ - # Debian ships with MariaDB instead of MySQL - mariadb-client \ - nano \ - openssh-client \ - openssh-server \ - postgresql-client \ - procps \ - pv \ - rsync \ - sudo \ - supervisor \ - unzip \ - webp \ - zip \ - ;\ - # Cleanup - apt-get clean; rm -rf /var/lib/apt/lists/* - -RUN set -xe; \ - # Create a regular user/group "docker" (uid = 1000, gid = 1000 ) - useradd -m -s /bin/bash -u 1000 -U -p docker docker; \ - # Give the docker user sudo access - usermod -a -G sudo docker; \ - echo 'docker ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers - -# gosu v1.14+ discorages using it as a non-root user (https://github.com/tianon/gosu/issues/11), which we rely on here. -# See https://github.com/tianon/gosu/pull/89/commits/8afd3dec5fb4fe0356e4fb5d358fe235f7311181 -# We'll stick with v1.13 for the time being. -# TODO: Replace gosu with sudo/su in startup.sh -ENV \ - GOSU_VERSION=1.13 \ - GOMPLATE_VERSION=3.11.3 -RUN set -xe; \ - # Install gosu and give access to the docker user primary group to use it. - # gosu is used instead of sudo to start the main container process (pid 1) in a docker friendly way. - # https://github.com/tianon/gosu - curl -fsSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${TARGETARCH} -o /usr/local/bin/gosu; \ - chown root:$(id -gn docker) /usr/local/bin/gosu; \ - chmod +sx /usr/local/bin/gosu; \ - # gomplate (to process configuration templates in startup.sh) - curl -fsSL https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-${TARGETARCH} -o /usr/local/bin/gomplate; \ - chmod +x /usr/local/bin/gomplate - -# Configure sshd (for use PHPStorm's remote interpreters and tools integrations) -# http://docs.docker.com/examples/running_ssh_service/ -RUN set -xe; \ - mkdir /var/run/sshd; \ - echo 'docker:docker' | chpasswd; \ - sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config; \ - # SSH login fix. Otherwise user is kicked off after login - sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd; \ - echo "export VISIBLE=now" >> /etc/profile -ENV NOTVISIBLE "in users profile" - -# PHP -RUN set -xe; \ - # Note: essential build tools (g++, gcc, make, etc) are included upstream as persistent packages. - buildDeps=" \ - libc-client2007e-dev \ - libfreetype6-dev \ - libgpgme11-dev \ - libicu-dev \ - libjpeg62-turbo-dev \ - libkrb5-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmemcached-dev \ - libmhash-dev \ - libpng-dev \ - libpq-dev \ - libwebp-dev \ - libssh2-1-dev \ - libxpm-dev \ - libxslt1-dev \ - libzip-dev \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - blackfire-php \ - libc-client2007e \ - libfreetype6 \ - libgpgme11 \ - libicu67 \ - libjpeg62-turbo \ - libldap-2.4-2 \ - libmagickcore-6.q16-*-extra \ - libmagickwand-6.q16-6 \ - libmemcached11 \ - libmemcachedutil2 \ - libmhash2 \ - libpng16-16 \ - libpq5 \ - libssh2-1 \ - libxpm4 \ - libxslt1.1 \ - libzip4 \ - ;\ - docker-php-ext-configure >/dev/null gd \ - --with-freetype \ - --with-jpeg \ - --with-webp \ - --with-xpm; \ - PHP_OPENSSL=yes docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \ - # Using $(uname -m) (returns x86_64 / aarch64) vs ${TARGETARCH} (returns amd64 / arm64) - docker-php-ext-configure >/dev/null ldap --with-libdir=lib/$(uname -m)-linux-gnu/; \ - docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \ - docker-php-ext-configure >/dev/null zip; \ - \ - docker-php-ext-install >/dev/null -j$(nproc) \ - bcmath \ - bz2 \ - calendar\ - exif \ - gd \ - gettext \ - imap \ - intl \ - ldap \ - mysqli \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - sockets \ - xsl \ - zip \ - sysvsem \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ - apt-get clean; rm -rf /var/lib/apt/lists/* - -# Packages not available for arm64 -RUN set -xe; \ - if [ "${TARGETARCH}" = "amd64" ]; then \ - # MSQSQL repo - msodbcsql17, pecl/sqlsrv and pecl/pdo_sqlsrv (PHP 7.0+ only) - curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ - echo 'deb https://packages.microsoft.com/debian/11/prod bullseye main' | tee /etc/apt/sources.list.d/mssql.list; \ - \ - buildDeps=" \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - # Necessary for msodbcsql17 (MSSQL) - ACCEPT_EULA=Y \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - msodbcsql17 \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ - apt-get clean; rm -rf /var/lib/apt/lists/*; \ - fi - -# PHP tools (installed globally) -ENV \ - COMPOSER_DEFAULT_VERSION=2 \ - COMPOSER_VERSION=1.10.26 \ - COMPOSER2_VERSION=2.5.1 \ - DRUSH_VERSION=8.4.11 \ - DRUSH_LAUNCHER_VERSION=0.10.1 \ - DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ - WPCLI_VERSION=2.7.1 \ - BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.0.2 \ - # acquia/cli v1.30.1 is the last version to support PHP 7.4 - ACQUIA_CLI_VERSION=1.30.1 \ - TERMINUS_VERSION=3.1.2 \ - JQ_VERSION=1.6 \ - YQ_VERSION=4.30.8 -RUN set -xe; \ - # Composer 1.x - curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ - # Composer 2.x - curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER2_VERSION}/composer.phar" -o /usr/local/bin/composer2; \ - # Drush 8 (global fallback) - curl -fsSL "https://github.com/drush-ops/drush/releases/download/${DRUSH_VERSION}/drush.phar" -o /usr/local/bin/drush8; \ - # Drush Launcher - curl -fsSL "https://github.com/drush-ops/drush-launcher/releases/download/${DRUSH_LAUNCHER_VERSION}/drush.phar" -o /usr/local/bin/drush; \ - # Drupal Console Launcher - curl -fsSL "https://github.com/hechoendrupal/drupal-console-launcher/releases/download/${DRUPAL_CONSOLE_LAUNCHER_VERSION}/drupal.phar" -o /usr/local/bin/drupal; \ - # Wordpress CLI - curl -fsSL "https://github.com/wp-cli/wp-cli/releases/download/v${WPCLI_VERSION}/wp-cli-${WPCLI_VERSION}.phar" -o /usr/local/bin/wp; \ - # Blackfire CLI - # Find out the most recent version number: - # curl -X GET -Is https://blackfire.io/api/v1/releases/cli/linux/amd64 | grep location | awk '{print $2}' - curl -fsSL "https://packages.blackfire.io/binaries/blackfire/${BLACKFIRE_VERSION}/blackfire-linux_${TARGETARCH}" -o /usr/local/bin/blackfire; \ - # Platform.sh CLI - curl -fsSL "https://github.com/platformsh/platformsh-cli/releases/download/v${PLATFORMSH_CLI_VERSION}/platform.phar" -o /usr/local/bin/platform; \ - # Acquia CLI - curl -fsSL "https://github.com/acquia/cli/releases/download/${ACQUIA_CLI_VERSION}/acli.phar" -o /usr/local/bin/acli; \ - # Pantheon Terminus - curl -fsSL "https://github.com/pantheon-systems/terminus/releases/download/${TERMINUS_VERSION}/terminus.phar" -o /usr/local/bin/terminus; \ - # jq (no arm64) - if [ "${TARGETARCH}" = "amd64" ]; then \ - curl -fsSL "https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64" -o /usr/local/bin/jq; \ - chmod +x /usr/local/bin/jq; \ - fi; \ - # yq - curl -fsSL "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_${TARGETARCH}" -o /usr/local/bin/yq; \ - # Set Default Composer Version - ln -s /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} /usr/local/bin/composer; \ - # Make all downloaded binaries executable in one shot - (cd /usr/local/bin && chmod +x composer1 composer2 drush8 drush drupal wp blackfire platform acli terminus yq); - -# Install Python 3 + pip from Debian repos -RUN set -xe; \ - apt-get update >/dev/null; \ - apt-get -y --no-install-recommends install >/dev/null \ - python3 \ - python3-pip \ - ;\ - # Cleanup - apt-get clean; rm -rf /var/lib/apt/lists/* - -# Install Ruby from Debian repos -RUN set -xe; \ - apt-get update >/dev/null; \ - apt-get -y --no-install-recommends install >/dev/null \ - ruby-full \ - ;\ - # Cleanup - apt-get clean; rm -rf /var/lib/apt/lists/* - -# All further RUN commands will run as the "docker" user -USER docker -SHELL ["/bin/bash", "-c"] - -# Don't use -x here, as the output may be excessive -RUN set -e; \ - \ - # Set drush8 as a global fallback for Drush Launcher - echo -e "\n""export DRUSH_LAUNCHER_FALLBACK=/usr/local/bin/drush8" >> $HOME/.profile; \ - # Composer based dependencies - # Add composer bin project level and global directories to PATH - # Project level comes first and thus takes precedence over the global one - echo -e "\n"'export PATH="$PATH:${PROJECT_ROOT:-/var/www}/vendor/bin"' >> $HOME/.profile; \ - echo -e "\n"'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> $HOME/.profile; \ - # Reload updated PATH from profile to make composer/drush/etc. visible below - . $HOME/.profile; \ - # Drupal Coder & WP Coding Standards w/ a matching version of PHP_CodeSniffer - # Set allow-plugins. See https://getcomposer.org/allow-plugins - composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true; \ - composer global require drupal/coder wp-coding-standards/wpcs phpcompatibility/phpcompatibility-wp; \ - # Don't fix the indentation or installed_paths will not be set correctly - phpcs --config-set installed_paths \ -$HOME/.composer/vendor/drupal/coder/coder_sniffer/,\ -$HOME/.composer/vendor/wp-coding-standards/wpcs/,\ -$HOME/.composer/vendor/phpcompatibility/php-compatibility/PHPCompatibility/,\ -$HOME/.composer/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP,\ -$HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat; \ - # Cleanup - composer clear-cache - -# Node.js (installed as user) -ENV \ - NVM_VERSION=0.39.3 \ - NODE_VERSION=18.13.0 \ - YARN_VERSION=1.22.19 -# Don't use -x here, as the output may be excessive -RUN set -e; \ - # NVM and a defaut Node.js version - export PROFILE="$HOME/.profile"; \ - curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash >/dev/null; \ - # Reload profile to load nvm (needed by Yarn installation below) - . $HOME/.profile; \ - # Yarn - export YARN_PROFILE="$HOME/.profile"; \ - curl -fsSL https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION} >/dev/null - -## Ruby (installed as user) via rvm -## Note: Disabled. rvm + its build dependecies bloat the image (~80MB) -## Debian 11 ships with Ruby 2.7, so we'll stick with that by default. -## It is still possible for the end user to switch to a different Ruby version via rvm. -#ENV \ -# RVM_VERSION_INSTALL=1.29.10 \ -# RUBY_VERSION_INSTALL=2.7.2 -## Don't use -x here, as the output may be excessive -#RUN set -e; \ -# # Export ruby gem bin path -# echo 'export PATH=$PATH:$(ruby -r rubygems -e "puts Gem.user_dir")/bin' >> $HOME/.profile; \ -# . $HOME/.profile; \ -# # Public GPG servers are not realiable, so downloading keys from rvm.io instead. -# #gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -# # Import and trust rvm keys -# # mpapis@gmail.com -# curl -sSL https://rvm.io/mpapis.asc | gpg --batch --import -; \ -# echo 409B6B1796C275462A1703113804BB82D39DC0E3:6: | gpg --batch --import-ownertrust; \ -# # piotr.kuczynski@gmail.com -# curl -sSL https://rvm.io/pkuczynski.asc | gpg --batch --import -; \ -# echo 7D2BAF1CF37B13E2069D6956105BD0E739499BDB:6: | gpg --batch --import-ownertrust; \ -# \ -# echo 'rvm_autoupdate_flag=0' >> $HOME/.rvmrc; \ -# echo 'rvm_silence_path_mismatch_check_flag=1' >> $HOME/.rvmrc; \ -# curl -fsSL https://raw.githubusercontent.com/rvm/rvm/${RVM_VERSION_INSTALL}/binscripts/rvm-installer | bash -s -- --ignore-dotfiles --version ${RVM_VERSION_INSTALL}; \ -# { \ -# echo ''; \ -# echo 'export PATH="$PATH:$HOME/.rvm/bin"'; \ -# echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"'; \ -# } >> $HOME/.profile; \ -# # Reload $HOME/.profile to apply settings for the current shell -# . $HOME/.profile; \ -# \ -# # rvm.io does not currently have ruby binaries for Debian 9, so Ruby is compiled from source, which requires a bunch -# # of extra dependencies installed (rvm installs these automatically), which bloat this image: -# # rvm/ruby required packages: gawk, automake, bison, libffi-dev, libgdbm-dev, libncurses5-dev, libsqlite3-dev, libtool, libyaml-dev, sqlite3, zlib1g-dev, libgmp-dev, libreadline-dev, libssl-dev -# rvm install ruby-${RUBY_VERSION_INSTALL}; \ -# rvm use ruby-${RUBY_VERSION_INSTALL} --default; \ -# \ -# gem install --user-install bundler; \ -# # Have bundler install gems locally (./.bundle) by default -# echo -e "\n"'export BUNDLE_PATH=.bundle' >> $HOME/.profile; \ -# \ -# rvm cleanup all; \ -# rvm gemset globalcache enable - -## Ruby bundler -## Don't use -x here, as the output may be excessive -RUN set -e; \ - # Export ruby gem bin path - echo 'export PATH=$PATH:$(ruby -r rubygems -e "puts Gem.user_dir")/bin' >> $HOME/.profile; \ - . $HOME/.profile; \ - gem install --user-install bundler; \ - # Have bundler install gems in the current directory (./.bundle) by default - echo -e "\n"'export BUNDLE_PATH=.bundle' >> $HOME/.profile - -# Python (installed as user) via pyenv -# Note: Disabled. pyenv + its build dependecies bloat the image (~300MB). -# Debian 10 ships with Python 3.7, so we'll stick with that by default. -# It is still possible for the end user to switch to a different python version via pyenv. -#ENV \ -# PYENV_VERSION_INSTALL=1.2.21 \ -# PYTHON_VERSION_INSTALL=3.8.3 -#RUN set -xe; \ -# # pyenv requires a bunch of build dependencies installed, which would bloat this image -# # See https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites -# sudo apt-get update >/dev/null; \ -# sudo apt-get -y --no-install-recommends install >/dev/null \ -# build-essential libssl-dev zlib1g-dev libbz2-dev \ -# libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ -# xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \ -# ;\ -# # Cleanup -# sudo apt-get clean; sudo rm -rf /var/lib/apt/lists/*; \ -# \ -# git clone --depth 1 -b v${PYENV_VERSION_INSTALL} https://github.com/pyenv/pyenv.git $HOME/.pyenv; \ -# rm -rf $HOME/.pyenv/.git; \ -# { \ -# echo ''; \ -# echo 'export PYENV_ROOT="$HOME/.pyenv"'; \ -# echo 'export PATH="$PYENV_ROOT/bin:$PATH"'; \ -# echo 'eval "$(pyenv init -)"'; \ -# } >> $HOME/.profile; \ -# # Reload $HOME/.profile to apply settings for the current shell -# . $HOME/.profile; \ -# pyenv install ${PYTHON_VERSION_INSTALL}; \ -# pyenv global ${PYTHON_VERSION_INSTALL} - -# Notify web container about started fin exec -RUN echo '(/opt/ping-web.sh &)' >> $HOME/.profile - -USER root -SHELL ["/bin/sh", "-c"] - -# Copy configs and scripts -COPY --chown=docker:docker config/.terminus /home/docker/.terminus -COPY --chown=docker:docker config/.ssh /home/docker/.ssh -COPY config/supervisor /etc/supervisor/conf.d -COPY startup.sh /opt/startup.sh -COPY healthcheck.sh /opt/healthcheck.sh -COPY ping-web.sh /opt/ping-web.sh -# PHP default settings, global overrides and fpm overrides -RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" -COPY config/php/zz-php.ini /usr/local/etc/php/conf.d/zz-php.ini -COPY config/php/xdebug.ini /opt/docker-php-ext-xdebug.ini -COPY config/php/xhprof.ini /opt/docker-php-ext-xhprof.ini -COPY config/php/opcache.ini /opt/docker-php-ext-opcache.ini -COPY config/php/zz-php-fpm.conf /usr/local/etc/php-fpm.d/zz-php-fpm.conf - -ENV \ - # ssh-agent proxy socket (requires docksal/ssh-agent) - SSH_AUTH_SOCK=/.ssh-agent/proxy-socket \ - # Set TERM so text editors/etc. can be used - TERM=xterm \ - # Allow PROJECT_ROOT to be universally used in fin custom commands (inside and outside cli) - PROJECT_ROOT=/var/www \ - # Default values for HOST_UID and HOST_GUI to match the default Ubuntu user. These are used in startup.sh - HOST_UID=1000 \ - HOST_GID=1000 \ - # Delay in seconds between pings web from cli, while running fin exec. 0 - disabled - WEB_KEEPALIVE=0 \ - # xdebug disabled by default - XDEBUG_ENABLED=0 \ - XHPROF_ENABLED=0 \ - XHPROF_OUTPUT_DIR=/tmp/xhprof - -# TODO: [v3] remove and set these via docker-compose -EXPOSE 9000 -EXPOSE 22 -EXPOSE 3000 - -WORKDIR /var/www - -# Starter script -ENTRYPOINT ["/opt/startup.sh"] - -# By default, launch supervisord to keep the container running. -CMD ["supervisord"] - -# Health check script -HEALTHCHECK --interval=5s --timeout=1s --retries=12 CMD ["/opt/healthcheck.sh"] - - -# Visual Studio Code Server flavor -FROM cli as code-server - -# Run as docker, so we don't have to fix permissions -USER docker - -ARG HOME=/home/docker - -ENV \ - CODE_SERVER_VERSION=4.9.1 \ - VSCODE_GITLENS_VERSION=13.2.0 \ - VSCODE_XDEBUG_VERSION=1.30.0 \ - VSCODE_HOME="${HOME}/code-server" - -# Install code-server -RUN set -xe; \ - curl -fsSL "https://github.com/cdr/code-server/releases/download/v${CODE_SERVER_VERSION}/code-server_${CODE_SERVER_VERSION}_${TARGETARCH}.deb" -o /tmp/code-server_${TARGETARCH}.deb; \ - sudo dpkg -i /tmp/code-server_${TARGETARCH}.deb; \ - rm -rf /tmp/*.* - -# Settings -COPY --chown=docker:docker config/code-server ${VSCODE_HOME} - -# Install extensions -# Note: Have to use --user-data-dir with --install-extension instead of --config -RUN set -xe; \ - code-server --user-data-dir=${VSCODE_HOME} --install-extension eamodio.gitlens@${VSCODE_GITLENS_VERSION}; \ - code-server --user-data-dir=${VSCODE_HOME} --install-extension felixfbecker.php-debug@${VSCODE_XDEBUG_VERSION} - -# Switch back to root (IMPORTANT!) -USER root diff --git a/7.4/Makefile b/7.4/Makefile deleted file mode 100644 index 3b167570..00000000 --- a/7.4/Makefile +++ /dev/null @@ -1,76 +0,0 @@ --include ../tests/env_make --include env_make - -IMAGE ?= docksal/cli -VERSION_PREFIX ?= php -VERSION ?= 7.4 -BUILD_IMAGE_TAG ?= $(IMAGE):$(VERSION_PREFIX)$(VERSION)-build -NAME = docksal-cli-$(VERSION)-$(GIT_SHA7) -CWD = $(shell pwd) - -# Improve write performance for /home/docker by turning it into a volume -VOLUMES = -v /home/docker - -.EXPORT_ALL_VARIABLES: - -.PHONY: build exec test push shell run start stop logs clean release - -default: build - -build: - docker build -t $(BUILD_IMAGE_TAG) . - -# See https://docs.docker.com/buildx/working-with-buildx/ -# See https://github.com/docker/buildx -buildx: - docker buildx build --tag $(BUILD_IMAGE_TAG) . -buildx-with-cache: - docker buildx build --cache-from=type=registry,ref=$(BUILD_IMAGE_TAG) --cache-to=type=inline --tag=$(BUILD_IMAGE_TAG) . - -test: - NAME=$(NAME) VERSION=$(VERSION) ../tests/test.bats - -push: - docker push $(BUILD_IMAGE_TAG) - -run: clean - docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG) - -# Copy files into container instead of mounting from the host at runtime. -# This allows running tests on a remote docker instance. -start: clean - docker create --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG) - docker cp ../tests/. $(NAME):/var/www/ - docker start $(NAME) - -# Only copy docroot (not config overrides) -start-bare: clean - docker create --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG) - docker cp ../tests/docroot/. $(NAME):/var/www/docroot/ - docker start $(NAME) - -# Non-interactive and non-tty docker exec (uses LF instead of CRLF line endings) -exec: - @docker exec -u docker $(NAME) bash -lc "$(CMD)" - -# Interactive docker exec -exec-it: - @docker exec -u docker -it $(NAME) bash -ilc "$(CMD)" - -shell: - @docker exec -u docker -it $(NAME) bash -il - -stop: - docker stop $(NAME) - -logs: - docker logs $(NAME) - -logs-follow: - docker logs -f $(NAME) - -clean: - docker rm -vf $(NAME) >/dev/null 2>&1 || true - -tags: - @../.github/scripts/docker-tags.sh diff --git a/7.4/config/.ssh/config b/7.4/config/.ssh/config deleted file mode 100644 index 74320faa..00000000 --- a/7.4/config/.ssh/config +++ /dev/null @@ -1,5 +0,0 @@ -# Disable remote host key checking and warnings -Host * - StrictHostKeyChecking no - UserKnownHostsFile /dev/null - LogLevel ERROR diff --git a/7.4/config/.ssh/id_rsa.tmpl b/7.4/config/.ssh/id_rsa.tmpl deleted file mode 100644 index 8c6c22f1..00000000 --- a/7.4/config/.ssh/id_rsa.tmpl +++ /dev/null @@ -1 +0,0 @@ -{{ getenv "SECRET_SSH_PRIVATE_KEY" | base64.Decode }} \ No newline at end of file diff --git a/7.4/config/.terminus/config.yml b/7.4/config/.terminus/config.yml deleted file mode 100644 index c7e89515..00000000 --- a/7.4/config/.terminus/config.yml +++ /dev/null @@ -1,2 +0,0 @@ -hide_update_message: true -hide_git_mode_warning: true \ No newline at end of file diff --git a/7.4/config/code-server/User/settings.json b/7.4/config/code-server/User/settings.json deleted file mode 100644 index 1007d613..00000000 --- a/7.4/config/code-server/User/settings.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - // XDebug Launch Configuration settings - "launch": { - "version": "0.2.0", - "configurations": [ - // Listener mode (recommended for most cases) - // Can be used to debug both: web and cli PHP sessions. - { - "name": "XDebug (listener)", - "type": "php", - "request": "launch", - "port": 9000 - }, - // Current script mode - // Note: IDE launches the script inside of the ide container and not the cli container. - { - "name": "XDebug (currently open script)", - "type": "php", - "request": "launch", - "program": "${file}", - "cwd": "${fileDirname}", - "port": 9000 - } - ] - }, - // File associations - "files.associations": { - "*.inc": "php", - "*.module": "php", - "*.install": "php", - "*.theme": "php", - "*.tpl.php": "php", - "*.test": "php", - "*.php": "php" - }, - "workbench.colorTheme": "Default Dark+" -} diff --git a/7.4/config/code-server/config.yaml.tmpl b/7.4/config/code-server/config.yaml.tmpl deleted file mode 100644 index 495d812e..00000000 --- a/7.4/config/code-server/config.yaml.tmpl +++ /dev/null @@ -1,9 +0,0 @@ -user-data-dir: {{ getenv "VSCODE_HOME" }} -bind-addr: 0.0.0.0:8080 -cert: false -{{ if (getenv "IDE_PASSWORD") }} -auth: password -password: {{ getenv "IDE_PASSWORD" }} -{{ else }} -auth: none -{{ end }} diff --git a/7.4/config/php/opcache.ini b/7.4/config/php/opcache.ini deleted file mode 100644 index bbc72325..00000000 --- a/7.4/config/php/opcache.ini +++ /dev/null @@ -1,3 +0,0 @@ -; Extention settings -[opcache] -opcache.preload=/var/www/.docksal/etc/php/preload.php diff --git a/7.4/config/php/xdebug.ini b/7.4/config/php/xdebug.ini deleted file mode 100644 index 90111271..00000000 --- a/7.4/config/php/xdebug.ini +++ /dev/null @@ -1,12 +0,0 @@ -[xdebug] -zend_extension=xdebug.so -; See https://xdebug.org/docs/all_settings#mode -xdebug.mode=debug -; xdebug.xdebug.client_host defaults to "localhost", which works with VS Code Server web IDE running locally -; For debugging from a "remote" host, xdebug.xdebug.client_host is set to ${DOCKSAL_HOST_IP} at runtime -; xdebug.xdebug.client_port defaults to "9003" in Xdebug 3. We use 9000 instead for backward compatibility with Xdebug 2. -xdebug.client_port=9000 -; TODO: Why do we have to set this? -xdebug.idekey=xdebug_session -; Increase max_nesting_level to support complex Drupal pages (default is 100) -xdebug.max_nesting_level=256 diff --git a/7.4/config/php/xhprof.ini b/7.4/config/php/xhprof.ini deleted file mode 100644 index 6c2e4dc9..00000000 --- a/7.4/config/php/xhprof.ini +++ /dev/null @@ -1,2 +0,0 @@ -[xhprof] -extension="xhprof.so" diff --git a/7.4/config/php/zz-php-fpm.conf b/7.4/config/php/zz-php-fpm.conf deleted file mode 100644 index d4fb5e22..00000000 --- a/7.4/config/php/zz-php-fpm.conf +++ /dev/null @@ -1,19 +0,0 @@ -; PHP-FPM settings - -[global] -; This pid file is used for Docker healthcheck -pid = /run/php-fpm.pid - -[www] -user = docker -catch_workers_output = yes -listen = 0.0.0.0:9000 -clear_env = no - -; PHP (FPM) settings -; See zz-php.ini for global (CLI and FPM) PHP settings -php_value[memory_limit] = 256M -php_value[max_execution_time] = 300 -php_value[upload_max_filesize] = 500M -php_value[post_max_size] = 500M -php_value[max_input_vars] = 2000 diff --git a/7.4/config/php/zz-php.ini b/7.4/config/php/zz-php.ini deleted file mode 100644 index aaf78a2e..00000000 --- a/7.4/config/php/zz-php.ini +++ /dev/null @@ -1,19 +0,0 @@ -; PHP global (CLI and FPM) settings -; To override settings for FPM use zz-php-fpm.conf -[php] -memory_limit = -1 -max_execution_time = 600 -date.timezone = UTC -display_errors = On -display_startup_errors = On - -[mail] -; Enable Mailhog integration by default -sendmail_path = '/usr/bin/msmtp -t --host=mail --port=1025 --from=docker@cli' - -; Extention settings -[opcache] -opcache.memory_consumption = 128 -[blackfire] -blackfire.agent_socket = 'tcp://blackfire:8307' -blackfire.apm_enabled = 0 diff --git a/7.4/config/supervisor/supervisord-code-server.conf.tmpl b/7.4/config/supervisor/supervisord-code-server.conf.tmpl deleted file mode 100644 index 7016f1a7..00000000 --- a/7.4/config/supervisor/supervisord-code-server.conf.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -# VS Code Server web IDE -[program:code-server] -# Using bash -lc here to load docker user profile (necessary for nvn/node to initialize) -command = gosu docker bash -lc '/usr/bin/code-server --config=${VSCODE_HOME}/config.yaml /var/www' -stdout_logfile = /var/log/supervisor/code-server-stdout -stderr_logfile = /var/log/supervisor/code-server-stderr diff --git a/7.4/config/supervisor/supervisord-crond.conf b/7.4/config/supervisor/supervisord-crond.conf deleted file mode 100644 index 33dbd8e1..00000000 --- a/7.4/config/supervisor/supervisord-crond.conf +++ /dev/null @@ -1,5 +0,0 @@ -[program:cron] -# Cron will only log to syslog and nothing else... -command = /usr/sbin/cron -f -stdout_logfile = /var/log/supervisor/cron-stdout -stderr_logfile = /var/log/supervisor/cron-stderr diff --git a/7.4/config/supervisor/supervisord-php-fpm.conf b/7.4/config/supervisor/supervisord-php-fpm.conf deleted file mode 100644 index b4420872..00000000 --- a/7.4/config/supervisor/supervisord-php-fpm.conf +++ /dev/null @@ -1,4 +0,0 @@ -[program:php-fpm] -command = /usr/local/sbin/php-fpm -stdout_logfile = /var/log/supervisor/php-fpm-stdout -stderr_logfile = /var/log/supervisor/php-fpm-stderr diff --git a/7.4/config/supervisor/supervisord-sshd.conf b/7.4/config/supervisor/supervisord-sshd.conf deleted file mode 100644 index de159108..00000000 --- a/7.4/config/supervisor/supervisord-sshd.conf +++ /dev/null @@ -1,4 +0,0 @@ -[program:sshd] -command = /usr/sbin/sshd -D -stdout_logfile = /var/log/supervisor/sshd-stdout -stderr_logfile = /var/log/supervisor/sshd-stderr diff --git a/7.4/config/supervisor/supervisord.conf b/7.4/config/supervisor/supervisord.conf deleted file mode 100644 index 32c7217a..00000000 --- a/7.4/config/supervisor/supervisord.conf +++ /dev/null @@ -1,6 +0,0 @@ -[supervisord] -nodaemon = true -# debug prints output from all services to stdout/stderr. -# This way logs can be reviewed with docker logs. -# Additionalluy, logs from specific services are forwarded to individual files on disk. -loglevel = debug diff --git a/7.4/healthcheck.sh b/7.4/healthcheck.sh deleted file mode 100755 index b4ab59d0..00000000 --- a/7.4/healthcheck.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# Initialization phase in startup.sh is complete -[[ -f /var/run/cli ]] || exit 1 - -# supervisor services are running -if [[ -f /run/supervisord.pid ]]; then - if [[ "${IDE_ENABLED}" == "1" ]]; then - # IDE mode - ps aux | grep code-server >/dev/null || exit 1 - else - # php-fpm/cli mode - [[ -f /run/php-fpm.pid ]] || exit 1 - [[ -f /run/sshd.pid ]] || exit 1 - fi -fi diff --git a/7.4/ping-web.sh b/7.4/ping-web.sh deleted file mode 100755 index 6a5ba7b8..00000000 --- a/7.4/ping-web.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Notify web container about started fin exec -if [[ "${WEB_KEEPALIVE}" != "0" ]] && [[ "${VIRTUAL_HOST}" != "" ]] -then - while true - do - curl -s -m 1 ${VIRTUAL_HOST}/exec_in_progress_inside_cli >/dev/null 2>&1 - sleep ${WEB_KEEPALIVE} - done -fi diff --git a/7.4/startup.sh b/7.4/startup.sh deleted file mode 100755 index 7861a81d..00000000 --- a/7.4/startup.sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/bash - -# This script is running as root by default. -# Switching to the docker user can be done via "gosu docker ". - -HOME_DIR='/home/docker' - -DEBUG=${DEBUG:-0} -# Turn debugging ON when cli is started in the service mode -[[ "$1" == "supervisord" ]] && DEBUG=1 -echo-debug () -{ - [[ "$DEBUG" != 0 ]] && echo "$(date +"%F %H:%M:%S") | $@" -} - -uid_gid_reset () -{ - if [[ "$HOST_UID" != "$(id -u docker)" ]] || [[ "$HOST_GID" != "$(id -g docker)" ]]; then - echo-debug "Updating docker user uid/gid to $HOST_UID/$HOST_GID to match the host user uid/gid..." - usermod -u "$HOST_UID" -o docker - groupmod -g "$HOST_GID" -o "$(id -gn docker)" - fi -} - -xdebug_enable () -{ - echo-debug "Enabling xdebug..." - ln -s /opt/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/ -} - -xhprof_enable () -{ - echo-debug "Enabling xhprof..." - cp /opt/docker-php-ext-xhprof.ini /usr/local/etc/php/conf.d/ - # Output directory to the ini file - echo "xhprof.output_dir = ${XHPROF_OUTPUT_DIR}" >> /usr/local/etc/php/conf.d/docker-php-ext-xhprof.ini - # Try to create directory if it doesn't exist - mkdir ${XHPROF_OUTPUT_DIR} || true - # Change owner of directory - chown docker:docker ${XHPROF_OUTPUT_DIR} -} - -opcache_preload_enable() -{ - echo-debug "Enabling opcache preload..." - ln -s /opt/docker-php-ext-opcache.ini /usr/local/etc/php/conf.d/ -} - -ide_mode_enable () -{ - echo-debug "Enabling web IDE..." - # Enabled only code-server service (disabled all other services) - # TODO: split IDE/cli and php-fpm entirely - rm -f /etc/supervisor/conf.d/supervisord-*.conf - render_tmpl "/etc/supervisor/conf.d/supervisord-code-server.conf" - render_tmpl "${VSCODE_HOME}/config.yaml" -} - -# Creates symlinks to project level overrides if they exist -php_settings () -{ - php_ini=/var/www/.docksal/etc/php/php.ini - if [[ -f ${php_ini} ]]; then - echo-debug "Found project level overrides for PHP. Including:" - echo-debug "${php_ini}" - ln -s /var/www/.docksal/etc/php/php.ini /usr/local/etc/php/conf.d/zzz-php.ini - fi - - php_fpm_conf=/var/www/.docksal/etc/php/php-fpm.conf - if [[ -f ${php_fpm_conf} ]]; then - echo-debug "Found project level overrides for PHP-FPM. Including:" - echo-debug "${php_fpm_conf}" - ln -s ${php_fpm_conf} /usr/local/etc/php-fpm.d/zzz-php-fpm.conf - fi -} - -add_ssh_key () -{ - echo-debug "Adding a private SSH key from SECRET_SSH_PRIVATE_KEY..." - render_tmpl "$HOME_DIR/.ssh/id_rsa" - chmod 0600 "$HOME_DIR/.ssh/id_rsa" -} - -# Helper function to render configs from go templates using gomplate -render_tmpl () -{ - local file="${1}" - local tmpl="${1}.tmpl" - - if [[ -f "${tmpl}" ]]; then - echo-debug "Rendering template: ${tmpl}..." - # gomplate started throwing an empty line into stderr in v3.7.0, so we have to mute it below - gomplate --file "${tmpl}" --out "${file}" &>/dev/null - else - echo-debug "Error: Template file not found: ${tmpl}" - return 1 - fi -} - -# Helper function to loop through all environment variables prefixed with SECRET_ and -# convert to the equivalent variable without SECRET. -# Example: SECRET_TERMINUS_TOKEN => TERMINUS_TOKEN. -convert_secrets () -{ - eval 'secrets=(${!SECRET_@})' - for secret_key in "${secrets[@]}"; do - key=${secret_key#SECRET_} - secret_value=${!secret_key} - - # Write new variables to /etc/profile.d/secrets.sh to make them available for all users/sessions - echo "export ${key}=\"${secret_value}\"" | tee -a "/etc/profile.d/secrets.sh" >/dev/null - - # Also export new variables here - # This makes them available in the server/php-fpm environment - eval "export ${key}=${secret_value}" - done -} - -# Pantheon (terminus) login -terminus_login () -{ - echo-debug "Authenticating with Pantheon..." - # This has to be done using the docker user via su to load the user environment - # Note: Using 'su -l' to initiate a login session and have .profile sourced for the docker user - local command="terminus auth:login --no-interaction --machine-token='${TERMINUS_TOKEN}'" - local output=$(su -l docker -c "${command}") - if [[ $? != 0 ]]; then - echo-debug "ERROR: Pantheon authentication failed." - echo - echo "$output" - echo - fi -} - -# Acquia CLI login -acli_login () -{ - echo-debug "Authenticating with Acquia..." - # This has to be done using the docker user via su to load the user environment - # Note: Using 'su -l' to initiate a login session and have .profile sourced for the docker user - local command="acli auth:login --key='${ACQUIA_CLI_KEY}' --secret='${ACQUIA_CLI_SECRET}' --no-interaction" - local output=$(su -l docker -c "${command}" 2>&1) - if [[ $? != 0 ]]; then - echo-debug "ERROR: Acquia authentication failed." - echo - echo "$output" - echo - fi -} - -# Git settings -git_settings () -{ - # These must be run as the docker user - echo-debug "Configuring git..." - # Set default git settings if none have been passed - # See https://github.com/docksal/service-cli/issues/124 - gosu docker git config --global user.email "${GIT_USER_EMAIL:-cli@docksal.io}" - gosu docker git config --global user.name "${GIT_USER_NAME:-Docksal CLI}" -} - -# Inject a private SSH key if provided -[[ "$SECRET_SSH_PRIVATE_KEY" != "" ]] && add_ssh_key - -# Set Composer Version -[[ "${COMPOSER_DEFAULT_VERSION}" != "" ]] && [[ -f /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} ]] && ln -sf /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} /usr/local/bin/composer - -# Convert all Environment Variables Prefixed with SECRET_ -convert_secrets - -# Docker user uid/gid mapping to the host user uid/gid -[[ "$HOST_UID" != "" ]] && [[ "$HOST_GID" != "" ]] && uid_gid_reset - -# Enable xdebug -[[ "$XDEBUG_ENABLED" != "" ]] && [[ "$XDEBUG_ENABLED" != "0" ]] && xdebug_enable - -# Enable xdebug -[[ "$XHPROF_ENABLED" != "" ]] && [[ "$XHPROF_ENABLED" != "0" ]] && xhprof_enable - -# Enable opcache preload -[[ -f "/var/www/.docksal/etc/php/preload.php" ]] && opcache_preload_enable - -# Enable web IDE -[[ "$IDE_ENABLED" != "" ]] && [[ "$IDE_ENABLED" != "0" ]] && ide_mode_enable - -# Include project level PHP settings if found -php_settings - -# Make sure permissions are correct (after uid/gid change and COPY operations in Dockerfile) -# To not bloat the image size, permissions on the home folder are reset at runtime. -echo-debug "Resetting permissions on $HOME_DIR and /var/www..." -chown "${HOST_UID:-1000}:${HOST_GID:-1000}" -R "$HOME_DIR" -# Docker resets the project root folder permissions to 0:0 when cli is recreated (e.g. an env variable updated). -# We apply a fix/workaround for this at startup (non-recursive). -chown "${HOST_UID:-1000}:${HOST_GID:-1000}" /var/www - -# These have to happen after the home directory permissions are reset, -# otherwise the docker user may not have write access to /home/docker, where the auth session data is stored. -# Automatically authenticate with Pantheon if Terminus token is present -[[ "$TERMINUS_TOKEN" != "" ]] && terminus_login - -# Authenticate to Acquia CLI -[[ "$ACQUIA_CLI_KEY" != "" ]] && [[ "$ACQUIA_CLI_SECRET" != "" ]] && acli_login - -# If crontab file is found within project add contents to user crontab file. -if [[ -f ${PROJECT_ROOT}/.docksal/services/cli/crontab ]]; then - echo-debug "Loading crontab..." - cat ${PROJECT_ROOT}/.docksal/services/cli/crontab | crontab -u docker - -fi - -# Apply git settings -[[ "$GIT_USER_EMAIL" != "" ]] && [[ "$GIT_USER_NAME" != "" ]] && git_settings - -# Initialization steps completed. Create a pid file to mark the container as healthy -echo-debug "Preliminary initialization completed." -touch /var/run/cli - -# Execute a custom startup script if present -if [[ -x ${PROJECT_ROOT}/.docksal/services/cli/startup.sh ]]; then - echo-debug "Running custom startup script..." - # TODO: should we source the script instead? - su -l docker -c "${PROJECT_ROOT}/.docksal/services/cli/startup.sh" - if [[ $? == 0 ]]; then - echo-debug "Custom startup script executed successfully." - else - echo-debug "ERROR: Custom startup script execution failed." - fi -fi - -# Execute passed CMD arguments -echo-debug "Passing execution to: $*" -# Service mode (run as root) -if [[ "$1" == "supervisord" ]]; then - exec gosu root supervisord -c /etc/supervisor/supervisord.conf -# Command mode (run as docker user) -else - exec gosu docker "$@" -fi diff --git a/7.4/tests/essential-binaries.sh b/7.4/tests/essential-binaries.sh deleted file mode 100755 index bcb35f30..00000000 --- a/7.4/tests/essential-binaries.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env bash - -binaries_amd64=\ -'bundler -cat -convert -curl -dig -g++ -ghostscript -git -git-lfs -gcc -jq -html2text -less -make -mc -more -mysql -nano -node -nvm -nslookup -php -ping -pip -psql -pv -python3 -rsync -ruby -sudo -unzip -wget -yq -zip' - -binaries_arm64=\ -'bundler -cat -convert -curl -dig -g++ -ghostscript -git -git-lfs -gcc -html2text -less -make -mc -more -mysql -nano -node -nvm -nslookup -php -ping -psql -pv -python3 -rsync -ruby -sudo -unzip -wget -yq -zip' - -# Use the docker reported architecture and not the hosts (uname -m). -# docker arch may not be the same as hosts's arch (e.g., when using a remote docker instance). -case "$(docker info -f '{{ .Architecture }}')" in - x86_64) echo "${binaries_amd64}" ;; - amd64) echo "${binaries_amd64}" ;; - aarch64) echo "${binaries_arm64}" ;; - arm64) echo "${binaries_arm64}" ;; - * ) false;; -esac diff --git a/7.4/tests/php-modules.sh b/7.4/tests/php-modules.sh deleted file mode 100755 index 8037c6d1..00000000 --- a/7.4/tests/php-modules.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env bash - -php_modules_amd64=\ -'[PHP Modules] -apcu -bcmath -blackfire -bz2 -calendar -Core -ctype -curl -date -dom -exif -fileinfo -filter -ftp -gd -gettext -gnupg -hash -iconv -imagick -imap -intl -json -ldap -libxml -mbstring -memcached -mysqli -mysqlnd -openssl -pcntl -pcre -PDO -pdo_mysql -pdo_pgsql -pdo_sqlite -pdo_sqlsrv -pgsql -Phar -posix -readline -redis -Reflection -session -SimpleXML -soap -sockets -sodium -SPL -sqlite3 -sqlsrv -ssh2 -standard -sysvsem -tokenizer -xml -xmlreader -xmlwriter -xsl -Zend OPcache -zip -zlib - -[Zend Modules] -Zend OPcache -blackfire -' - -php_modules_arm64=\ -'[PHP Modules] -apcu -bcmath -blackfire -bz2 -calendar -Core -ctype -curl -date -dom -exif -fileinfo -filter -ftp -gd -gettext -gnupg -hash -iconv -imagick -imap -intl -json -ldap -libxml -mbstring -memcached -mysqli -mysqlnd -openssl -pcntl -pcre -PDO -pdo_mysql -pdo_pgsql -pdo_sqlite -pgsql -Phar -posix -readline -redis -Reflection -session -SimpleXML -soap -sockets -sodium -SPL -sqlite3 -ssh2 -standard -sysvsem -tokenizer -xml -xmlreader -xmlwriter -xsl -Zend OPcache -zip -zlib - -[Zend Modules] -Zend OPcache -blackfire -' - -# Use the docker reported architecture and not the hosts (uname -m). -# docker arch may not be the same as hosts's arch (e.g., when using a remote docker instance). -case "$(docker info -f '{{ .Architecture }}')" in - x86_64) echo "${php_modules_amd64}" ;; - amd64) echo "${php_modules_amd64}" ;; - aarch64) echo "${php_modules_arm64}" ;; - arm64) echo "${php_modules_arm64}" ;; - * ) false;; -esac diff --git a/README.md b/README.md index 2b3603cd..1a053c6d 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,15 @@ This image(s) is part of the [Docksal](https://docksal.io) image library. ## Versions and image tag naming convention - Stable versions v3 (amd64/arm64) - - `php7.4-3.0`, `php7.4-2`, `php7.4` - PHP 7.4 - - `php8.0-3.0`, `php8.0`, `php8.0`, `latest` - PHP 8.0 + - `php8.0-3.0`, `php8.0`, `php8.0` - PHP 8.0 - `php8.1-3.0`, `php8.1`, `php8.1`, `latest` - PHP 8.1 - Development versions (amd64/arm64) - - `php7.4-edge` - PHP 7.4 - `php8.0-edge` - PHP 8.0 - `php8.1-edge` - PHP 8.0 -- Previous stable versions v3 (amd64/arm64) +- Legacy versions v3 (amd64/arm64) - `php7.3-3.0`, `php7.3-2`, `php7.3` - PHP 7.3 -- Previous stable versions v2 (amd64) + - `php7.4-3.3`, `php7.4-3`, `php7.4` - PHP 7.4 +- Legacy versions v2 (amd64) - `php7.3-2.13`, `php7.3-2`, `php7.3` - PHP 7.3 - `php7.4-2.13`, `php7.4-2`, `php7.4` - PHP 7.4 - `php8.0-2.13`, `php8.0`, `php8.0` - PHP 8.0 diff --git a/tests/test.bats b/tests/test.bats index 527e2591..fc80a75c 100755 --- a/tests/test.bats +++ b/tests/test.bats @@ -176,11 +176,6 @@ _healthcheck_wait () echo "$output" | grep "memory_limit => 128M => 128M" unset output - # Check Opcache Preload Enabled for 7.4 - run make exec -e CMD='php -i' - if [[ "${VERSION}" == "7.4" ]]; then echo "$output" | grep "opcache.preload"; fi - unset output - ### Cleanup ### make clean } From 39461efd7dd91ca916e192479be7930db5683838 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Tue, 14 Mar 2023 17:59:14 +0100 Subject: [PATCH 02/25] Bump PHP versions: 8.0.28, 8.1.16 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index b97dd6fd..fcaffce7 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0.27-fpm-bullseye as cli +FROM php:8.0.28-fpm-bullseye as cli ARG TARGETARCH ARG DEBIAN_FRONTEND=noninteractive diff --git a/8.1/Dockerfile b/8.1/Dockerfile index e9c75945..bf9222b0 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1.14-fpm-bullseye as cli +FROM php:8.1.16-fpm-bullseye as cli ARG TARGETARCH ARG DEBIAN_FRONTEND=noninteractive From 4b86f6d7df938033697862dac142444d9d368d20 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Tue, 14 Mar 2023 18:04:37 +0100 Subject: [PATCH 03/25] MSSQL PHP client installation updates Now available on both amd64 and arm64. --- 8.0/Dockerfile | 60 ++++++++++++++++++++-------------------- 8.0/tests/php-modules.sh | 2 ++ 8.1/Dockerfile | 60 ++++++++++++++++++++-------------------- 8.1/tests/php-modules.sh | 2 ++ 4 files changed, 64 insertions(+), 60 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index fcaffce7..7f4ef502 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -217,37 +217,37 @@ RUN set -xe; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps >/dev/null; \ apt-get clean; rm -rf /var/lib/apt/lists/* -# Packages not available for arm64 +# MSSQL PHP client RUN set -xe; \ - if [ "${TARGETARCH}" = "amd64" ]; then \ - # MSQSQL repo - msodbcsql17, pecl/sqlsrv and pecl/pdo_sqlsrv (PHP 7.0+ only) - curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ - echo 'deb https://packages.microsoft.com/debian/11/prod bullseye main' | tee /etc/apt/sources.list.d/mssql.list; \ - \ - buildDeps=" \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - # Necessary for msodbcsql17 (MSSQL) - ACCEPT_EULA=Y \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - msodbcsql17 \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ - apt-get clean; rm -rf /var/lib/apt/lists/*; \ - fi + # Repo for msodbcsql18 (MS ODBC driver), required by pecl/sqlsrv and pecl/pdo_sqlsrv + curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ + # TODO: Using Ubuntu 22.04 packages as a temporary fix (until addressed upstream in MS repos). + #curl -fsSL https://packages.microsoft.com/config/debian/11/prod.list -o /etc/apt/sources.list.d/mssql.list; \ + curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/prod.list -o /etc/apt/sources.list.d/mssql.list; \ + \ + buildDeps=" \ + unixodbc-dev \ + "; \ + apt-get update >/dev/null; \ + # Necessary for msodbcsql18 (MSSQL) + ACCEPT_EULA=Y \ + apt-get -y --no-install-recommends install >/dev/null \ + $buildDeps \ + msodbcsql18 \ + ;\ + pecl update-channels; \ + pecl install >/dev/null /dev/null; \ + apt-get clean; rm -rf /var/lib/apt/lists/* # PHP tools (installed globally) ENV \ diff --git a/8.0/tests/php-modules.sh b/8.0/tests/php-modules.sh index 8037c6d1..0d671ced 100755 --- a/8.0/tests/php-modules.sh +++ b/8.0/tests/php-modules.sh @@ -108,6 +108,7 @@ PDO pdo_mysql pdo_pgsql pdo_sqlite +pdo_sqlsrv pgsql Phar posix @@ -121,6 +122,7 @@ sockets sodium SPL sqlite3 +sqlsrv ssh2 standard sysvsem diff --git a/8.1/Dockerfile b/8.1/Dockerfile index bf9222b0..fcd2efcc 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -217,37 +217,37 @@ RUN set -xe; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps >/dev/null; \ apt-get clean; rm -rf /var/lib/apt/lists/* -# Packages not available for arm64 +# MSSQL PHP client RUN set -xe; \ - if [ "${TARGETARCH}" = "amd64" ]; then \ - # MSQSQL repo - msodbcsql17, pecl/sqlsrv and pecl/pdo_sqlsrv (PHP 7.0+ only) - curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ - echo 'deb https://packages.microsoft.com/debian/11/prod bullseye main' | tee /etc/apt/sources.list.d/mssql.list; \ - \ - buildDeps=" \ - unixodbc-dev \ - "; \ - apt-get update >/dev/null; \ - # Necessary for msodbcsql17 (MSSQL) - ACCEPT_EULA=Y \ - apt-get -y --no-install-recommends install >/dev/null \ - $buildDeps \ - msodbcsql17 \ - ;\ - pecl update-channels; \ - pecl install >/dev/null /dev/null; \ - apt-get clean; rm -rf /var/lib/apt/lists/*; \ - fi + # Repo for msodbcsql18 (MS ODBC driver), required by pecl/sqlsrv and pecl/pdo_sqlsrv + curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ + # TODO: Using Ubuntu 22.04 packages as a temporary fix (until addressed upstream in MS repos). + #curl -fsSL https://packages.microsoft.com/config/debian/11/prod.list -o /etc/apt/sources.list.d/mssql.list; \ + curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/prod.list -o /etc/apt/sources.list.d/mssql.list; \ + \ + buildDeps=" \ + unixodbc-dev \ + "; \ + apt-get update >/dev/null; \ + # Necessary for msodbcsql18 (MSSQL) + ACCEPT_EULA=Y \ + apt-get -y --no-install-recommends install >/dev/null \ + $buildDeps \ + msodbcsql18 \ + ;\ + pecl update-channels; \ + pecl install >/dev/null /dev/null; \ + apt-get clean; rm -rf /var/lib/apt/lists/* # PHP tools (installed globally) ENV \ diff --git a/8.1/tests/php-modules.sh b/8.1/tests/php-modules.sh index 8037c6d1..0d671ced 100755 --- a/8.1/tests/php-modules.sh +++ b/8.1/tests/php-modules.sh @@ -108,6 +108,7 @@ PDO pdo_mysql pdo_pgsql pdo_sqlite +pdo_sqlsrv pgsql Phar posix @@ -121,6 +122,7 @@ sockets sodium SPL sqlite3 +sqlsrv ssh2 standard sysvsem From a7f1e944d2857c3d7a4f0a17520138a8c9e6ff0e Mon Sep 17 00:00:00 2001 From: Shelane French Date: Wed, 1 Feb 2023 17:57:48 -0800 Subject: [PATCH 04/25] updates terminus 3.1.2 => 3.1.3 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 7f4ef502..ff24f28d 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -261,7 +261,7 @@ ENV \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.0.2 \ ACQUIA_CLI_VERSION=2.7.0 \ - TERMINUS_VERSION=3.1.2 \ + TERMINUS_VERSION=3.1.3 \ JQ_VERSION=1.6 \ YQ_VERSION=4.30.8 RUN set -xe; \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index fcd2efcc..7c2f10b3 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -261,7 +261,7 @@ ENV \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.0.2 \ ACQUIA_CLI_VERSION=2.7.0 \ - TERMINUS_VERSION=3.1.2 \ + TERMINUS_VERSION=3.1.3 \ JQ_VERSION=1.6 \ YQ_VERSION=4.30.8 RUN set -xe; \ From 8e0ea757dc014af95a6aa78b9f7568eae6889a6a Mon Sep 17 00:00:00 2001 From: Shelane French Date: Wed, 1 Feb 2023 17:58:26 -0800 Subject: [PATCH 05/25] updates acquia cli 2.7.0 => 2.8.0 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index ff24f28d..4f186e62 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.0.2 \ - ACQUIA_CLI_VERSION=2.7.0 \ + ACQUIA_CLI_VERSION=2.8.0 \ TERMINUS_VERSION=3.1.3 \ JQ_VERSION=1.6 \ YQ_VERSION=4.30.8 diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 7c2f10b3..d556f3c1 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.0.2 \ - ACQUIA_CLI_VERSION=2.7.0 \ + ACQUIA_CLI_VERSION=2.8.0 \ TERMINUS_VERSION=3.1.3 \ JQ_VERSION=1.6 \ YQ_VERSION=4.30.8 From e857751479ee118469bec7f1082ce59615e34db7 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Sun, 5 Feb 2023 13:10:17 -0800 Subject: [PATCH 06/25] updates composer 2.5.1 => 2.5.4 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 4f186e62..255c1dc7 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -253,7 +253,7 @@ RUN set -xe; \ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.26 \ - COMPOSER2_VERSION=2.5.1 \ + COMPOSER2_VERSION=2.5.4 \ DRUSH_VERSION=8.4.11 \ DRUSH_LAUNCHER_VERSION=0.10.1 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index d556f3c1..cc5b5d42 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -253,7 +253,7 @@ RUN set -xe; \ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.26 \ - COMPOSER2_VERSION=2.5.1 \ + COMPOSER2_VERSION=2.5.4 \ DRUSH_VERSION=8.4.11 \ DRUSH_LAUNCHER_VERSION=0.10.1 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ From 621f11b51b2c813b0e0e2ebebe057a47ce3dd172 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Wed, 22 Feb 2023 07:45:25 -0800 Subject: [PATCH 07/25] updates platformsh cli 4.0.2 => 4.1.2, updates path of repo name --- 8.0/Dockerfile | 4 ++-- 8.1/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 255c1dc7..c6447ab5 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.0.2 \ + PLATFORMSH_CLI_VERSION=4.1.2 \ ACQUIA_CLI_VERSION=2.8.0 \ TERMINUS_VERSION=3.1.3 \ JQ_VERSION=1.6 \ @@ -282,7 +282,7 @@ RUN set -xe; \ # curl -X GET -Is https://blackfire.io/api/v1/releases/cli/linux/amd64 | grep location | awk '{print $2}' curl -fsSL "https://packages.blackfire.io/binaries/blackfire/${BLACKFIRE_VERSION}/blackfire-linux_${TARGETARCH}" -o /usr/local/bin/blackfire; \ # Platform.sh CLI - curl -fsSL "https://github.com/platformsh/platformsh-cli/releases/download/v${PLATFORMSH_CLI_VERSION}/platform.phar" -o /usr/local/bin/platform; \ + curl -fsSL "https://github.com/platformsh/legacy-cli/releases/download/v${PLATFORMSH_CLI_VERSION}/platform.phar" -o /usr/local/bin/platform; \ # Acquia CLI curl -fsSL "https://github.com/acquia/cli/releases/download/${ACQUIA_CLI_VERSION}/acli.phar" -o /usr/local/bin/acli; \ # Pantheon Terminus diff --git a/8.1/Dockerfile b/8.1/Dockerfile index cc5b5d42..33de1b7e 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.0.2 \ + PLATFORMSH_CLI_VERSION=4.1.2 \ ACQUIA_CLI_VERSION=2.8.0 \ TERMINUS_VERSION=3.1.3 \ JQ_VERSION=1.6 \ @@ -282,7 +282,7 @@ RUN set -xe; \ # curl -X GET -Is https://blackfire.io/api/v1/releases/cli/linux/amd64 | grep location | awk '{print $2}' curl -fsSL "https://packages.blackfire.io/binaries/blackfire/${BLACKFIRE_VERSION}/blackfire-linux_${TARGETARCH}" -o /usr/local/bin/blackfire; \ # Platform.sh CLI - curl -fsSL "https://github.com/platformsh/platformsh-cli/releases/download/v${PLATFORMSH_CLI_VERSION}/platform.phar" -o /usr/local/bin/platform; \ + curl -fsSL "https://github.com/platformsh/legacy-cli/releases/download/v${PLATFORMSH_CLI_VERSION}/platform.phar" -o /usr/local/bin/platform; \ # Acquia CLI curl -fsSL "https://github.com/acquia/cli/releases/download/${ACQUIA_CLI_VERSION}/acli.phar" -o /usr/local/bin/acli; \ # Pantheon Terminus From 0dccf66d8a9e0ef7480caef1924b3e2863888f7d Mon Sep 17 00:00:00 2001 From: Shelane French Date: Wed, 1 Mar 2023 08:43:56 -0800 Subject: [PATCH 08/25] updates acquia cli 2.8.0 => 2.8.2 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index c6447ab5..3e53548a 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.1.2 \ - ACQUIA_CLI_VERSION=2.8.0 \ + ACQUIA_CLI_VERSION=2.8.2 \ TERMINUS_VERSION=3.1.3 \ JQ_VERSION=1.6 \ YQ_VERSION=4.30.8 diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 33de1b7e..5f5ad14e 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.1.2 \ - ACQUIA_CLI_VERSION=2.8.0 \ + ACQUIA_CLI_VERSION=2.8.2 \ TERMINUS_VERSION=3.1.3 \ JQ_VERSION=1.6 \ YQ_VERSION=4.30.8 From 05d23867581e74d20ddaf27695db10cec3823e88 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Thu, 2 Mar 2023 06:45:26 -0800 Subject: [PATCH 09/25] updates terminus 3.1.3 => 3.1.4 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 3e53548a..27911753 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -261,7 +261,7 @@ ENV \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.1.2 \ ACQUIA_CLI_VERSION=2.8.2 \ - TERMINUS_VERSION=3.1.3 \ + TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.30.8 RUN set -xe; \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 5f5ad14e..4c834c85 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -261,7 +261,7 @@ ENV \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.1.2 \ ACQUIA_CLI_VERSION=2.8.2 \ - TERMINUS_VERSION=3.1.3 \ + TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.30.8 RUN set -xe; \ From 4f0603201d1d666fbe355ee379f99bfdc9676df2 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Thu, 2 Mar 2023 06:45:45 -0800 Subject: [PATCH 10/25] updates yq 4.30.8 => 4.31.2 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 27911753..e31b5a37 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -263,7 +263,7 @@ ENV \ ACQUIA_CLI_VERSION=2.8.2 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ - YQ_VERSION=4.30.8 + YQ_VERSION=4.31.2 RUN set -xe; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 4c834c85..72477643 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -263,7 +263,7 @@ ENV \ ACQUIA_CLI_VERSION=2.8.2 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ - YQ_VERSION=4.30.8 + YQ_VERSION=4.31.2 RUN set -xe; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ From db33ee72d09465752cfb1d3145c091f3f6ee40fc Mon Sep 17 00:00:00 2001 From: Shelane French Date: Thu, 9 Mar 2023 10:24:14 -0800 Subject: [PATCH 11/25] updates platformsh 4.1.2 => 4.2.0 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index e31b5a37..52c924ad 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.1.2 \ + PLATFORMSH_CLI_VERSION=4.2.0 \ ACQUIA_CLI_VERSION=2.8.2 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 72477643..3e4a16c9 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.1.2 \ + PLATFORMSH_CLI_VERSION=4.2.0 \ ACQUIA_CLI_VERSION=2.8.2 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ From 239384b73ff892d0dc58a03033ce1093c60b99fd Mon Sep 17 00:00:00 2001 From: Shelane French Date: Thu, 9 Mar 2023 19:46:48 -0800 Subject: [PATCH 12/25] updates acquia cli 2.8.2 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 52c924ad..7fbac967 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.2.0 \ - ACQUIA_CLI_VERSION=2.8.2 \ + ACQUIA_CLI_VERSION=2.8.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.31.2 diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 3e4a16c9..f72996a5 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.2.0 \ - ACQUIA_CLI_VERSION=2.8.2 \ + ACQUIA_CLI_VERSION=2.8.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.31.2 From 9199edda70891067bf10ea8f322c1055d1b7dea5 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Fri, 10 Mar 2023 07:26:37 -0800 Subject: [PATCH 13/25] updates platformsh 4.2.0 => 4.2.1 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 7fbac967..4f0e6e1d 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.2.0 \ + PLATFORMSH_CLI_VERSION=4.2.1 \ ACQUIA_CLI_VERSION=2.8.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index f72996a5..0f67b66c 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.2.0 \ + PLATFORMSH_CLI_VERSION=4.2.1 \ ACQUIA_CLI_VERSION=2.8.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ From 6b5b68b6977e52db1f12520616f74c198c698ff5 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Wed, 15 Mar 2023 11:53:12 +0100 Subject: [PATCH 14/25] updates node.js 8.13.0 => 8.15.0 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 4f0e6e1d..d9381a9e 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -351,7 +351,7 @@ $HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibil # Node.js (installed as user) ENV \ NVM_VERSION=0.39.3 \ - NODE_VERSION=18.13.0 \ + NODE_VERSION=18.15.0 \ YARN_VERSION=1.22.19 # Don't use -x here, as the output may be excessive RUN set -e; \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 0f67b66c..9b9fbe45 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -351,7 +351,7 @@ $HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibil # Node.js (installed as user) ENV \ NVM_VERSION=0.39.3 \ - NODE_VERSION=18.13.0 \ + NODE_VERSION=18.15.0 \ YARN_VERSION=1.22.19 # Don't use -x here, as the output may be excessive RUN set -e; \ From b43004200806caffd83c2f7d8a4567fb247afd2e Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Wed, 15 Mar 2023 11:54:42 +0100 Subject: [PATCH 15/25] Pin acli at v2.8.0 See https://github.com/acquia/cli/issues/1426 --- 8.0/Dockerfile | 3 ++- 8.1/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index d9381a9e..b73ced8e 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -260,7 +260,8 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.2.1 \ - ACQUIA_CLI_VERSION=2.8.3 \ + # Pinned at 2.8.0 for now. See https://github.com/acquia/cli/issues/1426 + ACQUIA_CLI_VERSION=2.8.0 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.31.2 diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 9b9fbe45..35d250a0 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -260,7 +260,8 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.2.1 \ - ACQUIA_CLI_VERSION=2.8.3 \ + # Pinned at 2.8.0 for now. See https://github.com/acquia/cli/issues/1426 + ACQUIA_CLI_VERSION=2.8.0 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.31.2 From 7ba668403f9aa1af27fedfe719d4703825615e03 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Wed, 15 Mar 2023 10:57:51 +0100 Subject: [PATCH 16/25] Added PHP 8.2 --- .github/workflows/default.yaml | 19 +- 8.2/.dockerignore | 4 + 8.2/Dockerfile | 541 ++++++++++++++++++ 8.2/Makefile | 76 +++ 8.2/config/.ssh/config | 5 + 8.2/config/.ssh/id_rsa.tmpl | 1 + 8.2/config/.terminus/config.yml | 2 + 8.2/config/code-server/User/settings.json | 37 ++ 8.2/config/code-server/config.yaml.tmpl | 9 + 8.2/config/php/opcache.ini | 3 + 8.2/config/php/xdebug.ini | 12 + 8.2/config/php/xhprof.ini | 2 + 8.2/config/php/zz-php-fpm.conf | 19 + 8.2/config/php/zz-php.ini | 19 + .../supervisord-code-server.conf.tmpl | 6 + 8.2/config/supervisor/supervisord-crond.conf | 5 + .../supervisor/supervisord-php-fpm.conf | 4 + 8.2/config/supervisor/supervisord-sshd.conf | 4 + 8.2/config/supervisor/supervisord.conf | 6 + 8.2/healthcheck.sh | 16 + 8.2/ping-web.sh | 11 + 8.2/startup.sh | 238 ++++++++ 8.2/tests/essential-binaries.sh | 81 +++ 8.2/tests/php-modules.sh | 151 +++++ 24 files changed, 1270 insertions(+), 1 deletion(-) create mode 100644 8.2/.dockerignore create mode 100644 8.2/Dockerfile create mode 100644 8.2/Makefile create mode 100644 8.2/config/.ssh/config create mode 100644 8.2/config/.ssh/id_rsa.tmpl create mode 100644 8.2/config/.terminus/config.yml create mode 100644 8.2/config/code-server/User/settings.json create mode 100644 8.2/config/code-server/config.yaml.tmpl create mode 100644 8.2/config/php/opcache.ini create mode 100644 8.2/config/php/xdebug.ini create mode 100644 8.2/config/php/xhprof.ini create mode 100644 8.2/config/php/zz-php-fpm.conf create mode 100644 8.2/config/php/zz-php.ini create mode 100644 8.2/config/supervisor/supervisord-code-server.conf.tmpl create mode 100644 8.2/config/supervisor/supervisord-crond.conf create mode 100644 8.2/config/supervisor/supervisord-php-fpm.conf create mode 100644 8.2/config/supervisor/supervisord-sshd.conf create mode 100644 8.2/config/supervisor/supervisord.conf create mode 100755 8.2/healthcheck.sh create mode 100755 8.2/ping-web.sh create mode 100755 8.2/startup.sh create mode 100755 8.2/tests/essential-binaries.sh create mode 100755 8.2/tests/php-modules.sh diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index fc1f21cd..2f19eeea 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -19,7 +19,7 @@ defaults: env: IMAGE: docksal/cli UPSTREAM_IMAGE: debian - LATEST_VERSION: '8.1' + LATEST_VERSION: '8.2' DOCKSAL_VERSION: develop jobs: @@ -39,6 +39,10 @@ jobs: platform: linux/amd64 arch: amd64 version: '8.1' + - + platform: linux/amd64 + arch: amd64 + version: '8.2' - platform: linux/arm64 arch: arm64 @@ -47,6 +51,10 @@ jobs: platform: linux/arm64 arch: arm64 version: '8.1' + - + platform: linux/arm64 + arch: arm64 + version: '8.2' env: ARCH: ${{ matrix.arch }} @@ -120,6 +128,10 @@ jobs: platform: linux/amd64 arch: amd64 version: '8.1' + - + platform: linux/amd64 + arch: amd64 + version: '8.2' - platform: linux/arm64 arch: arm64 @@ -128,6 +140,10 @@ jobs: platform: linux/arm64 arch: arm64 version: '8.1' + - + platform: linux/arm64 + arch: arm64 + version: '8.2' env: ARCH: ${{ matrix.arch }} @@ -203,6 +219,7 @@ jobs: version: - '8.0' - '8.1' + - '8.2' env: VERSION_PREFIX: php diff --git a/8.2/.dockerignore b/8.2/.dockerignore new file mode 100644 index 00000000..0123c988 --- /dev/null +++ b/8.2/.dockerignore @@ -0,0 +1,4 @@ +tests +.dockerignore +Dockerfile +Makefile diff --git a/8.2/Dockerfile b/8.2/Dockerfile new file mode 100644 index 00000000..7bdf43b0 --- /dev/null +++ b/8.2/Dockerfile @@ -0,0 +1,541 @@ +FROM php:8.2.3-fpm-bullseye as cli + +ARG TARGETARCH +ARG DEBIAN_FRONTEND=noninteractive +ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 + +# Prevent services autoload (http://jpetazzo.github.io/2013/10/06/policy-rc-d-do-not-start-services-automatically/) +RUN set -xe; \ + echo '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d + +# Install basic packages +RUN set -xe; \ + apt-get update >/dev/null; \ + apt-get -y --no-install-recommends install >/dev/null \ + apt-transport-https \ + # ca-certificates and curl come from upstream + #ca-certificates \ + #curl \ + gnupg \ + locales \ + wget \ + ;\ + # Cleanup + apt-get clean; rm -rf /var/lib/apt/lists/* + +# Set en_US.UTF-8 as the default locale +RUN set -xe; \ + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LC_ALL en_US.utf8 + +# Enable additional repos +RUN set -xe; \ + sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; \ + # blackfire.io repo + curl -fsSL https://packages.blackfire.io/gpg.key | apt-key add -; \ + echo "deb https://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list; \ + # git-lfs repo + curl -fsSL https://packagecloud.io/github/git-lfs/gpgkey | apt-key add -; \ + echo 'deb https://packagecloud.io/github/git-lfs/debian bullseye main' | tee /etc/apt/sources.list.d/github_git-lfs.list; + +# Additional packages +RUN set -xe; \ + # Create man direcotries, otherwise some packages may not install (e.g. postgresql-client) + # This should be a temporary workaround until fixed upstream: https://github.com/debuerreotype/debuerreotype/issues/10 + mkdir -p /usr/share/man/man1 /usr/share/man/man7; \ + apt-get update >/dev/null; \ + apt-get -y --no-install-recommends install >/dev/null \ + cron \ + dnsutils \ + git \ + git-lfs \ + ghostscript \ + # html2text binary - used for self-testing (php-fpm) + html2text \ + imagemagick \ + iputils-ping \ + less \ + # cgi-fcgi binary - used for self-testing (php-fpm) + libfcgi-bin \ + mc \ + msmtp \ + # Debian ships with MariaDB instead of MySQL + mariadb-client \ + nano \ + openssh-client \ + openssh-server \ + postgresql-client \ + procps \ + pv \ + rsync \ + sudo \ + supervisor \ + unzip \ + webp \ + zip \ + ;\ + # Cleanup + apt-get clean; rm -rf /var/lib/apt/lists/* + +RUN set -xe; \ + # Create a regular user/group "docker" (uid = 1000, gid = 1000 ) + useradd -m -s /bin/bash -u 1000 -U -p docker docker; \ + # Give the docker user sudo access + usermod -a -G sudo docker; \ + echo 'docker ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# gosu v1.14+ discorages using it as a non-root user (https://github.com/tianon/gosu/issues/11), which we rely on here. +# See https://github.com/tianon/gosu/pull/89/commits/8afd3dec5fb4fe0356e4fb5d358fe235f7311181 +# We'll stick with v1.13 for the time being. +# TODO: Replace gosu with sudo/su in startup.sh +ENV \ + GOSU_VERSION=1.13 \ + GOMPLATE_VERSION=3.11.3 +RUN set -xe; \ + # Install gosu and give access to the docker user primary group to use it. + # gosu is used instead of sudo to start the main container process (pid 1) in a docker friendly way. + # https://github.com/tianon/gosu + curl -fsSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${TARGETARCH} -o /usr/local/bin/gosu; \ + chown root:$(id -gn docker) /usr/local/bin/gosu; \ + chmod +sx /usr/local/bin/gosu; \ + # gomplate (to process configuration templates in startup.sh) + curl -fsSL https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-${TARGETARCH} -o /usr/local/bin/gomplate; \ + chmod +x /usr/local/bin/gomplate + +# Configure sshd (for use PHPStorm's remote interpreters and tools integrations) +# http://docs.docker.com/examples/running_ssh_service/ +RUN set -xe; \ + mkdir /var/run/sshd; \ + echo 'docker:docker' | chpasswd; \ + sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config; \ + # SSH login fix. Otherwise user is kicked off after login + sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd; \ + echo "export VISIBLE=now" >> /etc/profile +ENV NOTVISIBLE "in users profile" + +# PHP +RUN set -xe; \ + # Note: essential build tools (g++, gcc, make, etc) are included upstream as persistent packages. + buildDeps=" \ + libc-client2007e-dev \ + libfreetype6-dev \ + libgpgme11-dev \ + libicu-dev \ + libjpeg62-turbo-dev \ + libkrb5-dev \ + libldap2-dev \ + libmagickcore-dev \ + libmagickwand-dev \ + libmemcached-dev \ + libmhash-dev \ + libpng-dev \ + libpq-dev \ + libwebp-dev \ + libssh2-1-dev \ + libxpm-dev \ + libxslt1-dev \ + libzip-dev \ + unixodbc-dev \ + "; \ + apt-get update >/dev/null; \ + apt-get -y --no-install-recommends install >/dev/null \ + $buildDeps \ + blackfire-php \ + libc-client2007e \ + libfreetype6 \ + libgpgme11 \ + libicu67 \ + libjpeg62-turbo \ + libldap-2.4-2 \ + libmagickcore-6.q16-*-extra \ + libmagickwand-6.q16-6 \ + libmemcached11 \ + libmemcachedutil2 \ + libmhash2 \ + libpng16-16 \ + libpq5 \ + libssh2-1 \ + libxpm4 \ + libxslt1.1 \ + libzip4 \ + ;\ + docker-php-ext-configure >/dev/null gd \ + --with-freetype \ + --with-jpeg \ + --with-webp \ + --with-xpm; \ + PHP_OPENSSL=yes docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \ + # Using $(uname -m) (returns x86_64 / aarch64) vs ${TARGETARCH} (returns amd64 / arm64) + docker-php-ext-configure >/dev/null ldap --with-libdir=lib/$(uname -m)-linux-gnu/; \ + docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \ + docker-php-ext-configure >/dev/null zip; \ + \ + docker-php-ext-install >/dev/null -j$(nproc) \ + bcmath \ + bz2 \ + calendar\ + exif \ + gd \ + gettext \ + imap \ + intl \ + ldap \ + mysqli \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + sockets \ + xsl \ + zip \ + sysvsem \ + ;\ + pecl update-channels; \ + pecl install >/dev/null /dev/null; \ + apt-get clean; rm -rf /var/lib/apt/lists/* + +# MSSQL PHP client +RUN set -xe; \ + # Repo for msodbcsql18 (MS ODBC driver), required by pecl/sqlsrv and pecl/pdo_sqlsrv + curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ + # TODO: Using Ubuntu 22.04 packages as a temporary fix (until addressed upstream in MS repos). + #curl -fsSL https://packages.microsoft.com/config/debian/11/prod.list -o /etc/apt/sources.list.d/mssql.list; \ + curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/prod.list -o /etc/apt/sources.list.d/mssql.list; \ + \ + buildDeps=" \ + unixodbc-dev \ + "; \ + apt-get update >/dev/null; \ + # Necessary for msodbcsql18 (MSSQL) + ACCEPT_EULA=Y \ + apt-get -y --no-install-recommends install >/dev/null \ + $buildDeps \ + msodbcsql18 \ + ;\ + pecl update-channels; \ + pecl install >/dev/null /dev/null; \ + apt-get clean; rm -rf /var/lib/apt/lists/* + +# PHP tools (installed globally) +ENV \ + COMPOSER_DEFAULT_VERSION=2 \ + COMPOSER_VERSION=1.10.26 \ + COMPOSER2_VERSION=2.5.4 \ + DRUSH_VERSION=8.4.11 \ + DRUSH_LAUNCHER_VERSION=0.10.1 \ + DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ + WPCLI_VERSION=2.7.1 \ + BLACKFIRE_VERSION=2.10.0 \ + PLATFORMSH_CLI_VERSION=4.2.1 \ + # Pinned at 2.8.0 for now. See https://github.com/acquia/cli/issues/1426 + ACQUIA_CLI_VERSION=2.8.0 \ + TERMINUS_VERSION=3.1.4 \ + JQ_VERSION=1.6 \ + YQ_VERSION=4.31.2 +RUN set -xe; \ + # Composer 1.x + curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ + # Composer 2.x + curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER2_VERSION}/composer.phar" -o /usr/local/bin/composer2; \ + # Drush 8 (global fallback) + curl -fsSL "https://github.com/drush-ops/drush/releases/download/${DRUSH_VERSION}/drush.phar" -o /usr/local/bin/drush8; \ + # Drush Launcher + curl -fsSL "https://github.com/drush-ops/drush-launcher/releases/download/${DRUSH_LAUNCHER_VERSION}/drush.phar" -o /usr/local/bin/drush; \ + # Drupal Console Launcher + curl -fsSL "https://github.com/hechoendrupal/drupal-console-launcher/releases/download/${DRUPAL_CONSOLE_LAUNCHER_VERSION}/drupal.phar" -o /usr/local/bin/drupal; \ + # Wordpress CLI + curl -fsSL "https://github.com/wp-cli/wp-cli/releases/download/v${WPCLI_VERSION}/wp-cli-${WPCLI_VERSION}.phar" -o /usr/local/bin/wp; \ + # Blackfire CLI + # Find out the most recent version number: + # curl -X GET -Is https://blackfire.io/api/v1/releases/cli/linux/amd64 | grep location | awk '{print $2}' + curl -fsSL "https://packages.blackfire.io/binaries/blackfire/${BLACKFIRE_VERSION}/blackfire-linux_${TARGETARCH}" -o /usr/local/bin/blackfire; \ + # Platform.sh CLI + curl -fsSL "https://github.com/platformsh/legacy-cli/releases/download/v${PLATFORMSH_CLI_VERSION}/platform.phar" -o /usr/local/bin/platform; \ + # Acquia CLI + curl -fsSL "https://github.com/acquia/cli/releases/download/${ACQUIA_CLI_VERSION}/acli.phar" -o /usr/local/bin/acli; \ + # Pantheon Terminus + curl -fsSL "https://github.com/pantheon-systems/terminus/releases/download/${TERMINUS_VERSION}/terminus.phar" -o /usr/local/bin/terminus; \ + # jq (no arm64) + if [ "${TARGETARCH}" = "amd64" ]; then \ + curl -fsSL "https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64" -o /usr/local/bin/jq; \ + chmod +x /usr/local/bin/jq; \ + fi; \ + # yq + curl -fsSL "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_${TARGETARCH}" -o /usr/local/bin/yq; \ + # Set Default Composer Version + ln -s /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} /usr/local/bin/composer; \ + # Make all downloaded binaries executable in one shot + (cd /usr/local/bin && chmod +x composer1 composer2 drush8 drush drupal wp blackfire platform acli terminus yq); + +# Install Python 3 + pip from Debian repos +RUN set -xe; \ + apt-get update >/dev/null; \ + apt-get -y --no-install-recommends install >/dev/null \ + python3 \ + python3-pip \ + ;\ + # Cleanup + apt-get clean; rm -rf /var/lib/apt/lists/* + +# Install Ruby from Debian repos +RUN set -xe; \ + apt-get update >/dev/null; \ + apt-get -y --no-install-recommends install >/dev/null \ + ruby-full \ + ;\ + # Cleanup + apt-get clean; rm -rf /var/lib/apt/lists/* + +# All further RUN commands will run as the "docker" user +USER docker +SHELL ["/bin/bash", "-c"] + +# Don't use -x here, as the output may be excessive +RUN set -e; \ + \ + # Set drush8 as a global fallback for Drush Launcher + echo -e "\n""export DRUSH_LAUNCHER_FALLBACK=/usr/local/bin/drush8" >> $HOME/.profile; \ + # Composer based dependencies + # Add composer bin project level and global directories to PATH + # Project level comes first and thus takes precedence over the global one + echo -e "\n"'export PATH="$PATH:${PROJECT_ROOT:-/var/www}/vendor/bin"' >> $HOME/.profile; \ + echo -e "\n"'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> $HOME/.profile; \ + # Reload updated PATH from profile to make composer/drush/etc. visible below + . $HOME/.profile; \ + # Drupal Coder & WP Coding Standards w/ a matching version of PHP_CodeSniffer + # Set allow-plugins. See https://getcomposer.org/allow-plugins + composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true; \ + composer global require drupal/coder wp-coding-standards/wpcs phpcompatibility/phpcompatibility-wp; \ + # Don't fix the indentation or installed_paths will not be set correctly + phpcs --config-set installed_paths \ +$HOME/.composer/vendor/drupal/coder/coder_sniffer/,\ +$HOME/.composer/vendor/wp-coding-standards/wpcs/,\ +$HOME/.composer/vendor/phpcompatibility/php-compatibility/PHPCompatibility/,\ +$HOME/.composer/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP,\ +$HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat; \ + # Cleanup + composer clear-cache + +# Node.js (installed as user) +ENV \ + NVM_VERSION=0.39.3 \ + NODE_VERSION=18.15.0 \ + YARN_VERSION=1.22.19 +# Don't use -x here, as the output may be excessive +RUN set -e; \ + # NVM and a defaut Node.js version + export PROFILE="$HOME/.profile"; \ + curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash >/dev/null; \ + # Reload profile to load nvm (needed by Yarn installation below) + . $HOME/.profile; \ + # Yarn + export YARN_PROFILE="$HOME/.profile"; \ + curl -fsSL https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION} >/dev/null + +## Ruby (installed as user) via rvm +## Note: Disabled. rvm + its build dependecies bloat the image (~80MB) +## Debian 11 ships with Ruby 2.7, so we'll stick with that by default. +## It is still possible for the end user to switch to a different Ruby version via rvm. +#ENV \ +# RVM_VERSION_INSTALL=1.29.10 \ +# RUBY_VERSION_INSTALL=2.7.2 +## Don't use -x here, as the output may be excessive +#RUN set -e; \ +# # Export ruby gem bin path +# echo 'export PATH=$PATH:$(ruby -r rubygems -e "puts Gem.user_dir")/bin' >> $HOME/.profile; \ +# . $HOME/.profile; \ +# # Public GPG servers are not realiable, so downloading keys from rvm.io instead. +# #gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB +# # Import and trust rvm keys +# # mpapis@gmail.com +# curl -sSL https://rvm.io/mpapis.asc | gpg --batch --import -; \ +# echo 409B6B1796C275462A1703113804BB82D39DC0E3:6: | gpg --batch --import-ownertrust; \ +# # piotr.kuczynski@gmail.com +# curl -sSL https://rvm.io/pkuczynski.asc | gpg --batch --import -; \ +# echo 7D2BAF1CF37B13E2069D6956105BD0E739499BDB:6: | gpg --batch --import-ownertrust; \ +# \ +# echo 'rvm_autoupdate_flag=0' >> $HOME/.rvmrc; \ +# echo 'rvm_silence_path_mismatch_check_flag=1' >> $HOME/.rvmrc; \ +# curl -fsSL https://raw.githubusercontent.com/rvm/rvm/${RVM_VERSION_INSTALL}/binscripts/rvm-installer | bash -s -- --ignore-dotfiles --version ${RVM_VERSION_INSTALL}; \ +# { \ +# echo ''; \ +# echo 'export PATH="$PATH:$HOME/.rvm/bin"'; \ +# echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"'; \ +# } >> $HOME/.profile; \ +# # Reload $HOME/.profile to apply settings for the current shell +# . $HOME/.profile; \ +# \ +# # rvm.io does not currently have ruby binaries for Debian 9, so Ruby is compiled from source, which requires a bunch +# # of extra dependencies installed (rvm installs these automatically), which bloat this image: +# # rvm/ruby required packages: gawk, automake, bison, libffi-dev, libgdbm-dev, libncurses5-dev, libsqlite3-dev, libtool, libyaml-dev, sqlite3, zlib1g-dev, libgmp-dev, libreadline-dev, libssl-dev +# rvm install ruby-${RUBY_VERSION_INSTALL}; \ +# rvm use ruby-${RUBY_VERSION_INSTALL} --default; \ +# \ +# gem install --user-install bundler; \ +# # Have bundler install gems locally (./.bundle) by default +# echo -e "\n"'export BUNDLE_PATH=.bundle' >> $HOME/.profile; \ +# \ +# rvm cleanup all; \ +# rvm gemset globalcache enable + +## Ruby bundler +## Don't use -x here, as the output may be excessive +RUN set -e; \ + # Export ruby gem bin path + echo 'export PATH=$PATH:$(ruby -r rubygems -e "puts Gem.user_dir")/bin' >> $HOME/.profile; \ + . $HOME/.profile; \ + gem install --user-install bundler; \ + # Have bundler install gems in the current directory (./.bundle) by default + echo -e "\n"'export BUNDLE_PATH=.bundle' >> $HOME/.profile + +# Python (installed as user) via pyenv +# Note: Disabled. pyenv + its build dependecies bloat the image (~300MB). +# Debian 10 ships with Python 3.7, so we'll stick with that by default. +# It is still possible for the end user to switch to a different python version via pyenv. +#ENV \ +# PYENV_VERSION_INSTALL=1.2.21 \ +# PYTHON_VERSION_INSTALL=3.8.3 +#RUN set -xe; \ +# # pyenv requires a bunch of build dependencies installed, which would bloat this image +# # See https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites +# sudo apt-get update >/dev/null; \ +# sudo apt-get -y --no-install-recommends install >/dev/null \ +# build-essential libssl-dev zlib1g-dev libbz2-dev \ +# libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ +# xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \ +# ;\ +# # Cleanup +# sudo apt-get clean; sudo rm -rf /var/lib/apt/lists/*; \ +# \ +# git clone --depth 1 -b v${PYENV_VERSION_INSTALL} https://github.com/pyenv/pyenv.git $HOME/.pyenv; \ +# rm -rf $HOME/.pyenv/.git; \ +# { \ +# echo ''; \ +# echo 'export PYENV_ROOT="$HOME/.pyenv"'; \ +# echo 'export PATH="$PYENV_ROOT/bin:$PATH"'; \ +# echo 'eval "$(pyenv init -)"'; \ +# } >> $HOME/.profile; \ +# # Reload $HOME/.profile to apply settings for the current shell +# . $HOME/.profile; \ +# pyenv install ${PYTHON_VERSION_INSTALL}; \ +# pyenv global ${PYTHON_VERSION_INSTALL} + +# Notify web container about started fin exec +RUN echo '(/opt/ping-web.sh &)' >> $HOME/.profile + +USER root +SHELL ["/bin/sh", "-c"] + +# Copy configs and scripts +COPY --chown=docker:docker config/.terminus /home/docker/.terminus +COPY --chown=docker:docker config/.ssh /home/docker/.ssh +COPY config/supervisor /etc/supervisor/conf.d +COPY startup.sh /opt/startup.sh +COPY healthcheck.sh /opt/healthcheck.sh +COPY ping-web.sh /opt/ping-web.sh +# PHP default settings, global overrides and fpm overrides +RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" +COPY config/php/zz-php.ini /usr/local/etc/php/conf.d/zz-php.ini +COPY config/php/xdebug.ini /opt/docker-php-ext-xdebug.ini +COPY config/php/xhprof.ini /opt/docker-php-ext-xhprof.ini +COPY config/php/opcache.ini /opt/docker-php-ext-opcache.ini +COPY config/php/zz-php-fpm.conf /usr/local/etc/php-fpm.d/zz-php-fpm.conf + +ENV \ + # ssh-agent proxy socket (requires docksal/ssh-agent) + SSH_AUTH_SOCK=/.ssh-agent/proxy-socket \ + # Set TERM so text editors/etc. can be used + TERM=xterm \ + # Allow PROJECT_ROOT to be universally used in fin custom commands (inside and outside cli) + PROJECT_ROOT=/var/www \ + # Default values for HOST_UID and HOST_GUI to match the default Ubuntu user. These are used in startup.sh + HOST_UID=1000 \ + HOST_GID=1000 \ + # Delay in seconds between pings web from cli, while running fin exec. 0 - disabled + WEB_KEEPALIVE=0 \ + # xdebug disabled by default + XDEBUG_ENABLED=0 \ + XHPROF_ENABLED=0 \ + XHPROF_OUTPUT_DIR=/tmp/xhprof + +# TODO: [v3] remove and set these via docker-compose +EXPOSE 9000 +EXPOSE 22 +EXPOSE 3000 + +WORKDIR /var/www + +# Starter script +ENTRYPOINT ["/opt/startup.sh"] + +# By default, launch supervisord to keep the container running. +CMD ["supervisord"] + +# Health check script +HEALTHCHECK --interval=5s --timeout=1s --retries=12 CMD ["/opt/healthcheck.sh"] + + +# Visual Studio Code Server flavor +FROM cli as code-server + +# Run as docker, so we don't have to fix permissions +USER docker + +ARG HOME=/home/docker + +ENV \ + CODE_SERVER_VERSION=4.9.1 \ + VSCODE_GITLENS_VERSION=13.2.0 \ + VSCODE_XDEBUG_VERSION=1.30.0 \ + VSCODE_HOME="${HOME}/code-server" + +# Install code-server +RUN set -xe; \ + curl -fsSL "https://github.com/cdr/code-server/releases/download/v${CODE_SERVER_VERSION}/code-server_${CODE_SERVER_VERSION}_${TARGETARCH}.deb" -o /tmp/code-server_${TARGETARCH}.deb; \ + sudo dpkg -i /tmp/code-server_${TARGETARCH}.deb; \ + rm -rf /tmp/*.* + +# Settings +COPY --chown=docker:docker config/code-server ${VSCODE_HOME} + +# Install extensions +# Note: Have to use --user-data-dir with --install-extension instead of --config +RUN set -xe; \ + code-server --user-data-dir=${VSCODE_HOME} --install-extension eamodio.gitlens@${VSCODE_GITLENS_VERSION}; \ + code-server --user-data-dir=${VSCODE_HOME} --install-extension felixfbecker.php-debug@${VSCODE_XDEBUG_VERSION} + +# Switch back to root (IMPORTANT!) +USER root diff --git a/8.2/Makefile b/8.2/Makefile new file mode 100644 index 00000000..009a6879 --- /dev/null +++ b/8.2/Makefile @@ -0,0 +1,76 @@ +-include ../tests/env_make +-include env_make + +IMAGE ?= docksal/cli +VERSION_PREFIX ?= php +VERSION ?= 8.2 +BUILD_IMAGE_TAG ?= $(IMAGE):$(VERSION_PREFIX)$(VERSION)-build +NAME = docksal-cli-$(VERSION)-$(GIT_SHA7) +CWD = $(shell pwd) + +# Improve write performance for /home/docker by turning it into a volume +VOLUMES = -v /home/docker + +.EXPORT_ALL_VARIABLES: + +.PHONY: build exec test push shell run start stop logs clean release + +default: build + +build: + docker build -t $(BUILD_IMAGE_TAG) . + +# See https://docs.docker.com/buildx/working-with-buildx/ +# See https://github.com/docker/buildx +buildx: + docker buildx build --tag $(BUILD_IMAGE_TAG) . +buildx-with-cache: + docker buildx build --cache-from=type=registry,ref=$(BUILD_IMAGE_TAG) --cache-to=type=inline --tag=$(BUILD_IMAGE_TAG) . + +test: + NAME=$(NAME) VERSION=$(VERSION) ../tests/test.bats + +push: + docker push $(BUILD_IMAGE_TAG) + +run: clean + docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG) + +# Copy files into container instead of mounting from the host at runtime. +# This allows running tests on a remote docker instance. +start: clean + docker create --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG) + docker cp ../tests/. $(NAME):/var/www/ + docker start $(NAME) + +# Only copy docroot (not config overrides) +start-bare: clean + docker create --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG) + docker cp ../tests/docroot/. $(NAME):/var/www/docroot/ + docker start $(NAME) + +# Non-interactive and non-tty docker exec (uses LF instead of CRLF line endings) +exec: + @docker exec -u docker $(NAME) bash -lc "$(CMD)" + +# Interactive docker exec +exec-it: + @docker exec -u docker -it $(NAME) bash -ilc "$(CMD)" + +shell: + @docker exec -u docker -it $(NAME) bash -il + +stop: + docker stop $(NAME) + +logs: + docker logs $(NAME) + +logs-follow: + docker logs -f $(NAME) + +clean: + docker rm -vf $(NAME) >/dev/null 2>&1 || true + +tags: + @../.github/scripts/docker-tags.sh diff --git a/8.2/config/.ssh/config b/8.2/config/.ssh/config new file mode 100644 index 00000000..74320faa --- /dev/null +++ b/8.2/config/.ssh/config @@ -0,0 +1,5 @@ +# Disable remote host key checking and warnings +Host * + StrictHostKeyChecking no + UserKnownHostsFile /dev/null + LogLevel ERROR diff --git a/8.2/config/.ssh/id_rsa.tmpl b/8.2/config/.ssh/id_rsa.tmpl new file mode 100644 index 00000000..8c6c22f1 --- /dev/null +++ b/8.2/config/.ssh/id_rsa.tmpl @@ -0,0 +1 @@ +{{ getenv "SECRET_SSH_PRIVATE_KEY" | base64.Decode }} \ No newline at end of file diff --git a/8.2/config/.terminus/config.yml b/8.2/config/.terminus/config.yml new file mode 100644 index 00000000..c7e89515 --- /dev/null +++ b/8.2/config/.terminus/config.yml @@ -0,0 +1,2 @@ +hide_update_message: true +hide_git_mode_warning: true \ No newline at end of file diff --git a/8.2/config/code-server/User/settings.json b/8.2/config/code-server/User/settings.json new file mode 100644 index 00000000..1007d613 --- /dev/null +++ b/8.2/config/code-server/User/settings.json @@ -0,0 +1,37 @@ +{ + // XDebug Launch Configuration settings + "launch": { + "version": "0.2.0", + "configurations": [ + // Listener mode (recommended for most cases) + // Can be used to debug both: web and cli PHP sessions. + { + "name": "XDebug (listener)", + "type": "php", + "request": "launch", + "port": 9000 + }, + // Current script mode + // Note: IDE launches the script inside of the ide container and not the cli container. + { + "name": "XDebug (currently open script)", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 9000 + } + ] + }, + // File associations + "files.associations": { + "*.inc": "php", + "*.module": "php", + "*.install": "php", + "*.theme": "php", + "*.tpl.php": "php", + "*.test": "php", + "*.php": "php" + }, + "workbench.colorTheme": "Default Dark+" +} diff --git a/8.2/config/code-server/config.yaml.tmpl b/8.2/config/code-server/config.yaml.tmpl new file mode 100644 index 00000000..495d812e --- /dev/null +++ b/8.2/config/code-server/config.yaml.tmpl @@ -0,0 +1,9 @@ +user-data-dir: {{ getenv "VSCODE_HOME" }} +bind-addr: 0.0.0.0:8080 +cert: false +{{ if (getenv "IDE_PASSWORD") }} +auth: password +password: {{ getenv "IDE_PASSWORD" }} +{{ else }} +auth: none +{{ end }} diff --git a/8.2/config/php/opcache.ini b/8.2/config/php/opcache.ini new file mode 100644 index 00000000..bbc72325 --- /dev/null +++ b/8.2/config/php/opcache.ini @@ -0,0 +1,3 @@ +; Extention settings +[opcache] +opcache.preload=/var/www/.docksal/etc/php/preload.php diff --git a/8.2/config/php/xdebug.ini b/8.2/config/php/xdebug.ini new file mode 100644 index 00000000..90111271 --- /dev/null +++ b/8.2/config/php/xdebug.ini @@ -0,0 +1,12 @@ +[xdebug] +zend_extension=xdebug.so +; See https://xdebug.org/docs/all_settings#mode +xdebug.mode=debug +; xdebug.xdebug.client_host defaults to "localhost", which works with VS Code Server web IDE running locally +; For debugging from a "remote" host, xdebug.xdebug.client_host is set to ${DOCKSAL_HOST_IP} at runtime +; xdebug.xdebug.client_port defaults to "9003" in Xdebug 3. We use 9000 instead for backward compatibility with Xdebug 2. +xdebug.client_port=9000 +; TODO: Why do we have to set this? +xdebug.idekey=xdebug_session +; Increase max_nesting_level to support complex Drupal pages (default is 100) +xdebug.max_nesting_level=256 diff --git a/8.2/config/php/xhprof.ini b/8.2/config/php/xhprof.ini new file mode 100644 index 00000000..6c2e4dc9 --- /dev/null +++ b/8.2/config/php/xhprof.ini @@ -0,0 +1,2 @@ +[xhprof] +extension="xhprof.so" diff --git a/8.2/config/php/zz-php-fpm.conf b/8.2/config/php/zz-php-fpm.conf new file mode 100644 index 00000000..d4fb5e22 --- /dev/null +++ b/8.2/config/php/zz-php-fpm.conf @@ -0,0 +1,19 @@ +; PHP-FPM settings + +[global] +; This pid file is used for Docker healthcheck +pid = /run/php-fpm.pid + +[www] +user = docker +catch_workers_output = yes +listen = 0.0.0.0:9000 +clear_env = no + +; PHP (FPM) settings +; See zz-php.ini for global (CLI and FPM) PHP settings +php_value[memory_limit] = 256M +php_value[max_execution_time] = 300 +php_value[upload_max_filesize] = 500M +php_value[post_max_size] = 500M +php_value[max_input_vars] = 2000 diff --git a/8.2/config/php/zz-php.ini b/8.2/config/php/zz-php.ini new file mode 100644 index 00000000..aaf78a2e --- /dev/null +++ b/8.2/config/php/zz-php.ini @@ -0,0 +1,19 @@ +; PHP global (CLI and FPM) settings +; To override settings for FPM use zz-php-fpm.conf +[php] +memory_limit = -1 +max_execution_time = 600 +date.timezone = UTC +display_errors = On +display_startup_errors = On + +[mail] +; Enable Mailhog integration by default +sendmail_path = '/usr/bin/msmtp -t --host=mail --port=1025 --from=docker@cli' + +; Extention settings +[opcache] +opcache.memory_consumption = 128 +[blackfire] +blackfire.agent_socket = 'tcp://blackfire:8307' +blackfire.apm_enabled = 0 diff --git a/8.2/config/supervisor/supervisord-code-server.conf.tmpl b/8.2/config/supervisor/supervisord-code-server.conf.tmpl new file mode 100644 index 00000000..7016f1a7 --- /dev/null +++ b/8.2/config/supervisor/supervisord-code-server.conf.tmpl @@ -0,0 +1,6 @@ +# VS Code Server web IDE +[program:code-server] +# Using bash -lc here to load docker user profile (necessary for nvn/node to initialize) +command = gosu docker bash -lc '/usr/bin/code-server --config=${VSCODE_HOME}/config.yaml /var/www' +stdout_logfile = /var/log/supervisor/code-server-stdout +stderr_logfile = /var/log/supervisor/code-server-stderr diff --git a/8.2/config/supervisor/supervisord-crond.conf b/8.2/config/supervisor/supervisord-crond.conf new file mode 100644 index 00000000..33dbd8e1 --- /dev/null +++ b/8.2/config/supervisor/supervisord-crond.conf @@ -0,0 +1,5 @@ +[program:cron] +# Cron will only log to syslog and nothing else... +command = /usr/sbin/cron -f +stdout_logfile = /var/log/supervisor/cron-stdout +stderr_logfile = /var/log/supervisor/cron-stderr diff --git a/8.2/config/supervisor/supervisord-php-fpm.conf b/8.2/config/supervisor/supervisord-php-fpm.conf new file mode 100644 index 00000000..b4420872 --- /dev/null +++ b/8.2/config/supervisor/supervisord-php-fpm.conf @@ -0,0 +1,4 @@ +[program:php-fpm] +command = /usr/local/sbin/php-fpm +stdout_logfile = /var/log/supervisor/php-fpm-stdout +stderr_logfile = /var/log/supervisor/php-fpm-stderr diff --git a/8.2/config/supervisor/supervisord-sshd.conf b/8.2/config/supervisor/supervisord-sshd.conf new file mode 100644 index 00000000..de159108 --- /dev/null +++ b/8.2/config/supervisor/supervisord-sshd.conf @@ -0,0 +1,4 @@ +[program:sshd] +command = /usr/sbin/sshd -D +stdout_logfile = /var/log/supervisor/sshd-stdout +stderr_logfile = /var/log/supervisor/sshd-stderr diff --git a/8.2/config/supervisor/supervisord.conf b/8.2/config/supervisor/supervisord.conf new file mode 100644 index 00000000..32c7217a --- /dev/null +++ b/8.2/config/supervisor/supervisord.conf @@ -0,0 +1,6 @@ +[supervisord] +nodaemon = true +# debug prints output from all services to stdout/stderr. +# This way logs can be reviewed with docker logs. +# Additionalluy, logs from specific services are forwarded to individual files on disk. +loglevel = debug diff --git a/8.2/healthcheck.sh b/8.2/healthcheck.sh new file mode 100755 index 00000000..b4ab59d0 --- /dev/null +++ b/8.2/healthcheck.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Initialization phase in startup.sh is complete +[[ -f /var/run/cli ]] || exit 1 + +# supervisor services are running +if [[ -f /run/supervisord.pid ]]; then + if [[ "${IDE_ENABLED}" == "1" ]]; then + # IDE mode + ps aux | grep code-server >/dev/null || exit 1 + else + # php-fpm/cli mode + [[ -f /run/php-fpm.pid ]] || exit 1 + [[ -f /run/sshd.pid ]] || exit 1 + fi +fi diff --git a/8.2/ping-web.sh b/8.2/ping-web.sh new file mode 100755 index 00000000..6a5ba7b8 --- /dev/null +++ b/8.2/ping-web.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Notify web container about started fin exec +if [[ "${WEB_KEEPALIVE}" != "0" ]] && [[ "${VIRTUAL_HOST}" != "" ]] +then + while true + do + curl -s -m 1 ${VIRTUAL_HOST}/exec_in_progress_inside_cli >/dev/null 2>&1 + sleep ${WEB_KEEPALIVE} + done +fi diff --git a/8.2/startup.sh b/8.2/startup.sh new file mode 100755 index 00000000..7861a81d --- /dev/null +++ b/8.2/startup.sh @@ -0,0 +1,238 @@ +#!/bin/bash + +# This script is running as root by default. +# Switching to the docker user can be done via "gosu docker ". + +HOME_DIR='/home/docker' + +DEBUG=${DEBUG:-0} +# Turn debugging ON when cli is started in the service mode +[[ "$1" == "supervisord" ]] && DEBUG=1 +echo-debug () +{ + [[ "$DEBUG" != 0 ]] && echo "$(date +"%F %H:%M:%S") | $@" +} + +uid_gid_reset () +{ + if [[ "$HOST_UID" != "$(id -u docker)" ]] || [[ "$HOST_GID" != "$(id -g docker)" ]]; then + echo-debug "Updating docker user uid/gid to $HOST_UID/$HOST_GID to match the host user uid/gid..." + usermod -u "$HOST_UID" -o docker + groupmod -g "$HOST_GID" -o "$(id -gn docker)" + fi +} + +xdebug_enable () +{ + echo-debug "Enabling xdebug..." + ln -s /opt/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/ +} + +xhprof_enable () +{ + echo-debug "Enabling xhprof..." + cp /opt/docker-php-ext-xhprof.ini /usr/local/etc/php/conf.d/ + # Output directory to the ini file + echo "xhprof.output_dir = ${XHPROF_OUTPUT_DIR}" >> /usr/local/etc/php/conf.d/docker-php-ext-xhprof.ini + # Try to create directory if it doesn't exist + mkdir ${XHPROF_OUTPUT_DIR} || true + # Change owner of directory + chown docker:docker ${XHPROF_OUTPUT_DIR} +} + +opcache_preload_enable() +{ + echo-debug "Enabling opcache preload..." + ln -s /opt/docker-php-ext-opcache.ini /usr/local/etc/php/conf.d/ +} + +ide_mode_enable () +{ + echo-debug "Enabling web IDE..." + # Enabled only code-server service (disabled all other services) + # TODO: split IDE/cli and php-fpm entirely + rm -f /etc/supervisor/conf.d/supervisord-*.conf + render_tmpl "/etc/supervisor/conf.d/supervisord-code-server.conf" + render_tmpl "${VSCODE_HOME}/config.yaml" +} + +# Creates symlinks to project level overrides if they exist +php_settings () +{ + php_ini=/var/www/.docksal/etc/php/php.ini + if [[ -f ${php_ini} ]]; then + echo-debug "Found project level overrides for PHP. Including:" + echo-debug "${php_ini}" + ln -s /var/www/.docksal/etc/php/php.ini /usr/local/etc/php/conf.d/zzz-php.ini + fi + + php_fpm_conf=/var/www/.docksal/etc/php/php-fpm.conf + if [[ -f ${php_fpm_conf} ]]; then + echo-debug "Found project level overrides for PHP-FPM. Including:" + echo-debug "${php_fpm_conf}" + ln -s ${php_fpm_conf} /usr/local/etc/php-fpm.d/zzz-php-fpm.conf + fi +} + +add_ssh_key () +{ + echo-debug "Adding a private SSH key from SECRET_SSH_PRIVATE_KEY..." + render_tmpl "$HOME_DIR/.ssh/id_rsa" + chmod 0600 "$HOME_DIR/.ssh/id_rsa" +} + +# Helper function to render configs from go templates using gomplate +render_tmpl () +{ + local file="${1}" + local tmpl="${1}.tmpl" + + if [[ -f "${tmpl}" ]]; then + echo-debug "Rendering template: ${tmpl}..." + # gomplate started throwing an empty line into stderr in v3.7.0, so we have to mute it below + gomplate --file "${tmpl}" --out "${file}" &>/dev/null + else + echo-debug "Error: Template file not found: ${tmpl}" + return 1 + fi +} + +# Helper function to loop through all environment variables prefixed with SECRET_ and +# convert to the equivalent variable without SECRET. +# Example: SECRET_TERMINUS_TOKEN => TERMINUS_TOKEN. +convert_secrets () +{ + eval 'secrets=(${!SECRET_@})' + for secret_key in "${secrets[@]}"; do + key=${secret_key#SECRET_} + secret_value=${!secret_key} + + # Write new variables to /etc/profile.d/secrets.sh to make them available for all users/sessions + echo "export ${key}=\"${secret_value}\"" | tee -a "/etc/profile.d/secrets.sh" >/dev/null + + # Also export new variables here + # This makes them available in the server/php-fpm environment + eval "export ${key}=${secret_value}" + done +} + +# Pantheon (terminus) login +terminus_login () +{ + echo-debug "Authenticating with Pantheon..." + # This has to be done using the docker user via su to load the user environment + # Note: Using 'su -l' to initiate a login session and have .profile sourced for the docker user + local command="terminus auth:login --no-interaction --machine-token='${TERMINUS_TOKEN}'" + local output=$(su -l docker -c "${command}") + if [[ $? != 0 ]]; then + echo-debug "ERROR: Pantheon authentication failed." + echo + echo "$output" + echo + fi +} + +# Acquia CLI login +acli_login () +{ + echo-debug "Authenticating with Acquia..." + # This has to be done using the docker user via su to load the user environment + # Note: Using 'su -l' to initiate a login session and have .profile sourced for the docker user + local command="acli auth:login --key='${ACQUIA_CLI_KEY}' --secret='${ACQUIA_CLI_SECRET}' --no-interaction" + local output=$(su -l docker -c "${command}" 2>&1) + if [[ $? != 0 ]]; then + echo-debug "ERROR: Acquia authentication failed." + echo + echo "$output" + echo + fi +} + +# Git settings +git_settings () +{ + # These must be run as the docker user + echo-debug "Configuring git..." + # Set default git settings if none have been passed + # See https://github.com/docksal/service-cli/issues/124 + gosu docker git config --global user.email "${GIT_USER_EMAIL:-cli@docksal.io}" + gosu docker git config --global user.name "${GIT_USER_NAME:-Docksal CLI}" +} + +# Inject a private SSH key if provided +[[ "$SECRET_SSH_PRIVATE_KEY" != "" ]] && add_ssh_key + +# Set Composer Version +[[ "${COMPOSER_DEFAULT_VERSION}" != "" ]] && [[ -f /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} ]] && ln -sf /usr/local/bin/composer${COMPOSER_DEFAULT_VERSION} /usr/local/bin/composer + +# Convert all Environment Variables Prefixed with SECRET_ +convert_secrets + +# Docker user uid/gid mapping to the host user uid/gid +[[ "$HOST_UID" != "" ]] && [[ "$HOST_GID" != "" ]] && uid_gid_reset + +# Enable xdebug +[[ "$XDEBUG_ENABLED" != "" ]] && [[ "$XDEBUG_ENABLED" != "0" ]] && xdebug_enable + +# Enable xdebug +[[ "$XHPROF_ENABLED" != "" ]] && [[ "$XHPROF_ENABLED" != "0" ]] && xhprof_enable + +# Enable opcache preload +[[ -f "/var/www/.docksal/etc/php/preload.php" ]] && opcache_preload_enable + +# Enable web IDE +[[ "$IDE_ENABLED" != "" ]] && [[ "$IDE_ENABLED" != "0" ]] && ide_mode_enable + +# Include project level PHP settings if found +php_settings + +# Make sure permissions are correct (after uid/gid change and COPY operations in Dockerfile) +# To not bloat the image size, permissions on the home folder are reset at runtime. +echo-debug "Resetting permissions on $HOME_DIR and /var/www..." +chown "${HOST_UID:-1000}:${HOST_GID:-1000}" -R "$HOME_DIR" +# Docker resets the project root folder permissions to 0:0 when cli is recreated (e.g. an env variable updated). +# We apply a fix/workaround for this at startup (non-recursive). +chown "${HOST_UID:-1000}:${HOST_GID:-1000}" /var/www + +# These have to happen after the home directory permissions are reset, +# otherwise the docker user may not have write access to /home/docker, where the auth session data is stored. +# Automatically authenticate with Pantheon if Terminus token is present +[[ "$TERMINUS_TOKEN" != "" ]] && terminus_login + +# Authenticate to Acquia CLI +[[ "$ACQUIA_CLI_KEY" != "" ]] && [[ "$ACQUIA_CLI_SECRET" != "" ]] && acli_login + +# If crontab file is found within project add contents to user crontab file. +if [[ -f ${PROJECT_ROOT}/.docksal/services/cli/crontab ]]; then + echo-debug "Loading crontab..." + cat ${PROJECT_ROOT}/.docksal/services/cli/crontab | crontab -u docker - +fi + +# Apply git settings +[[ "$GIT_USER_EMAIL" != "" ]] && [[ "$GIT_USER_NAME" != "" ]] && git_settings + +# Initialization steps completed. Create a pid file to mark the container as healthy +echo-debug "Preliminary initialization completed." +touch /var/run/cli + +# Execute a custom startup script if present +if [[ -x ${PROJECT_ROOT}/.docksal/services/cli/startup.sh ]]; then + echo-debug "Running custom startup script..." + # TODO: should we source the script instead? + su -l docker -c "${PROJECT_ROOT}/.docksal/services/cli/startup.sh" + if [[ $? == 0 ]]; then + echo-debug "Custom startup script executed successfully." + else + echo-debug "ERROR: Custom startup script execution failed." + fi +fi + +# Execute passed CMD arguments +echo-debug "Passing execution to: $*" +# Service mode (run as root) +if [[ "$1" == "supervisord" ]]; then + exec gosu root supervisord -c /etc/supervisor/supervisord.conf +# Command mode (run as docker user) +else + exec gosu docker "$@" +fi diff --git a/8.2/tests/essential-binaries.sh b/8.2/tests/essential-binaries.sh new file mode 100755 index 00000000..bcb35f30 --- /dev/null +++ b/8.2/tests/essential-binaries.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash + +binaries_amd64=\ +'bundler +cat +convert +curl +dig +g++ +ghostscript +git +git-lfs +gcc +jq +html2text +less +make +mc +more +mysql +nano +node +nvm +nslookup +php +ping +pip +psql +pv +python3 +rsync +ruby +sudo +unzip +wget +yq +zip' + +binaries_arm64=\ +'bundler +cat +convert +curl +dig +g++ +ghostscript +git +git-lfs +gcc +html2text +less +make +mc +more +mysql +nano +node +nvm +nslookup +php +ping +psql +pv +python3 +rsync +ruby +sudo +unzip +wget +yq +zip' + +# Use the docker reported architecture and not the hosts (uname -m). +# docker arch may not be the same as hosts's arch (e.g., when using a remote docker instance). +case "$(docker info -f '{{ .Architecture }}')" in + x86_64) echo "${binaries_amd64}" ;; + amd64) echo "${binaries_amd64}" ;; + aarch64) echo "${binaries_arm64}" ;; + arm64) echo "${binaries_arm64}" ;; + * ) false;; +esac diff --git a/8.2/tests/php-modules.sh b/8.2/tests/php-modules.sh new file mode 100755 index 00000000..0d671ced --- /dev/null +++ b/8.2/tests/php-modules.sh @@ -0,0 +1,151 @@ +#!/usr/bin/env bash + +php_modules_amd64=\ +'[PHP Modules] +apcu +bcmath +blackfire +bz2 +calendar +Core +ctype +curl +date +dom +exif +fileinfo +filter +ftp +gd +gettext +gnupg +hash +iconv +imagick +imap +intl +json +ldap +libxml +mbstring +memcached +mysqli +mysqlnd +openssl +pcntl +pcre +PDO +pdo_mysql +pdo_pgsql +pdo_sqlite +pdo_sqlsrv +pgsql +Phar +posix +readline +redis +Reflection +session +SimpleXML +soap +sockets +sodium +SPL +sqlite3 +sqlsrv +ssh2 +standard +sysvsem +tokenizer +xml +xmlreader +xmlwriter +xsl +Zend OPcache +zip +zlib + +[Zend Modules] +Zend OPcache +blackfire +' + +php_modules_arm64=\ +'[PHP Modules] +apcu +bcmath +blackfire +bz2 +calendar +Core +ctype +curl +date +dom +exif +fileinfo +filter +ftp +gd +gettext +gnupg +hash +iconv +imagick +imap +intl +json +ldap +libxml +mbstring +memcached +mysqli +mysqlnd +openssl +pcntl +pcre +PDO +pdo_mysql +pdo_pgsql +pdo_sqlite +pdo_sqlsrv +pgsql +Phar +posix +readline +redis +Reflection +session +SimpleXML +soap +sockets +sodium +SPL +sqlite3 +sqlsrv +ssh2 +standard +sysvsem +tokenizer +xml +xmlreader +xmlwriter +xsl +Zend OPcache +zip +zlib + +[Zend Modules] +Zend OPcache +blackfire +' + +# Use the docker reported architecture and not the hosts (uname -m). +# docker arch may not be the same as hosts's arch (e.g., when using a remote docker instance). +case "$(docker info -f '{{ .Architecture }}')" in + x86_64) echo "${php_modules_amd64}" ;; + amd64) echo "${php_modules_amd64}" ;; + aarch64) echo "${php_modules_arm64}" ;; + arm64) echo "${php_modules_arm64}" ;; + * ) false;; +esac From b7ff60c44a3865fca45002399ededb2982cadc00 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Wed, 15 Mar 2023 13:40:40 +0100 Subject: [PATCH 17/25] Updated the list of PHP 8.2 modules in tests --- 8.2/tests/php-modules.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/8.2/tests/php-modules.sh b/8.2/tests/php-modules.sh index 0d671ced..c869be2b 100755 --- a/8.2/tests/php-modules.sh +++ b/8.2/tests/php-modules.sh @@ -42,6 +42,7 @@ pdo_sqlsrv pgsql Phar posix +random readline redis Reflection @@ -112,6 +113,7 @@ pdo_sqlsrv pgsql Phar posix +random readline redis Reflection From ef06991bb607f8d21fe408c9d9f484fbcf0bd661 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Wed, 15 Mar 2023 17:30:28 +0100 Subject: [PATCH 18/25] Bump drush fallback from 8.4.11 to 8.4.12 Fixes PHP 8.1 and PHP 8.2 compatibility --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 8.2/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index b73ced8e..83f1da87 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -254,7 +254,7 @@ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.26 \ COMPOSER2_VERSION=2.5.4 \ - DRUSH_VERSION=8.4.11 \ + DRUSH_VERSION=8.4.12 \ DRUSH_LAUNCHER_VERSION=0.10.1 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 35d250a0..a3abfb0c 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -254,7 +254,7 @@ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.26 \ COMPOSER2_VERSION=2.5.4 \ - DRUSH_VERSION=8.4.11 \ + DRUSH_VERSION=8.4.12 \ DRUSH_LAUNCHER_VERSION=0.10.1 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 7bdf43b0..9da99826 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -254,7 +254,7 @@ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.26 \ COMPOSER2_VERSION=2.5.4 \ - DRUSH_VERSION=8.4.11 \ + DRUSH_VERSION=8.4.12 \ DRUSH_LAUNCHER_VERSION=0.10.1 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ From 66db2517895231add7f76b167d45a2b3d75c717c Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Wed, 15 Mar 2023 17:31:51 +0100 Subject: [PATCH 19/25] Bump VS Code Server versions - VS Code Server 4.10.1 - Gitlens 13.2.2 - VS Code xdebug 1.32.0 --- 8.0/Dockerfile | 6 +++--- 8.1/Dockerfile | 6 +++--- 8.2/Dockerfile | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 83f1da87..478edce9 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -517,9 +517,9 @@ USER docker ARG HOME=/home/docker ENV \ - CODE_SERVER_VERSION=4.9.1 \ - VSCODE_GITLENS_VERSION=13.2.0 \ - VSCODE_XDEBUG_VERSION=1.30.0 \ + CODE_SERVER_VERSION=4.10.1 \ + VSCODE_GITLENS_VERSION=13.2.2 \ + VSCODE_XDEBUG_VERSION=1.32.0 \ VSCODE_HOME="${HOME}/code-server" # Install code-server diff --git a/8.1/Dockerfile b/8.1/Dockerfile index a3abfb0c..51cb5a30 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -517,9 +517,9 @@ USER docker ARG HOME=/home/docker ENV \ - CODE_SERVER_VERSION=4.9.1 \ - VSCODE_GITLENS_VERSION=13.2.0 \ - VSCODE_XDEBUG_VERSION=1.30.0 \ + CODE_SERVER_VERSION=4.10.1 \ + VSCODE_GITLENS_VERSION=13.2.2 \ + VSCODE_XDEBUG_VERSION=1.32.0 \ VSCODE_HOME="${HOME}/code-server" # Install code-server diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 9da99826..44a4c81f 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -517,9 +517,9 @@ USER docker ARG HOME=/home/docker ENV \ - CODE_SERVER_VERSION=4.9.1 \ - VSCODE_GITLENS_VERSION=13.2.0 \ - VSCODE_XDEBUG_VERSION=1.30.0 \ + CODE_SERVER_VERSION=4.10.1 \ + VSCODE_GITLENS_VERSION=13.2.2 \ + VSCODE_XDEBUG_VERSION=1.32.0 \ VSCODE_HOME="${HOME}/code-server" # Install code-server From 1f1abf7910d113f061c63bb710bb5f754d7ecf13 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Wed, 15 Mar 2023 19:33:23 +0100 Subject: [PATCH 20/25] Bumped acli from 2.8.0 to 2.8.6 Relaxed the version check in tests to account for the tailing ".0" in "acli --version" version output starting from acli v2.8.1+ See https://github.com/acquia/cli/issues/1426 --- 8.0/Dockerfile | 3 +-- 8.1/Dockerfile | 3 +-- 8.2/Dockerfile | 3 +-- tests/test.bats | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 478edce9..6872d955 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -260,8 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.2.1 \ - # Pinned at 2.8.0 for now. See https://github.com/acquia/cli/issues/1426 - ACQUIA_CLI_VERSION=2.8.0 \ + ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.31.2 diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 51cb5a30..8511f47c 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -260,8 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.2.1 \ - # Pinned at 2.8.0 for now. See https://github.com/acquia/cli/issues/1426 - ACQUIA_CLI_VERSION=2.8.0 \ + ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.31.2 diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 44a4c81f..212efa0f 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -260,8 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.2.1 \ - # Pinned at 2.8.0 for now. See https://github.com/acquia/cli/issues/1426 - ACQUIA_CLI_VERSION=2.8.0 \ + ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.31.2 diff --git a/tests/test.bats b/tests/test.bats index fc80a75c..bcb66111 100755 --- a/tests/test.bats +++ b/tests/test.bats @@ -237,7 +237,7 @@ _healthcheck_wait () unset output # Check Acquia CLI version - run docker exec -u docker "$NAME" bash -lc 'set -x; acli --version | grep "^Acquia CLI ${ACQUIA_CLI_VERSION}$"' + run docker exec -u docker "$NAME" bash -lc 'set -x; acli --version | grep "^Acquia CLI ${ACQUIA_CLI_VERSION}"' [[ ${status} == 0 ]] unset output From 95439c98ed0ea708843709a967f53f402a06024f Mon Sep 17 00:00:00 2001 From: Shelane French Date: Sun, 19 Mar 2023 13:21:06 -0700 Subject: [PATCH 21/25] updates yq 4.31.2 => 4.32.2 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 8.2/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 6872d955..cb1fa8db 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -263,7 +263,7 @@ ENV \ ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ - YQ_VERSION=4.31.2 + YQ_VERSION=4.32.2 RUN set -xe; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 8511f47c..b92ddd21 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -263,7 +263,7 @@ ENV \ ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ - YQ_VERSION=4.31.2 + YQ_VERSION=4.32.2 RUN set -xe; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 212efa0f..d7f1d91a 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -263,7 +263,7 @@ ENV \ ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ - YQ_VERSION=4.31.2 + YQ_VERSION=4.32.2 RUN set -xe; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ From d481f3166e2c0e2829832d4816b9489c8b5cbe9a Mon Sep 17 00:00:00 2001 From: Shelane French Date: Sun, 19 Mar 2023 13:23:31 -0700 Subject: [PATCH 22/25] updates platformsh legacy 4.2.1 => 4.3.0 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 8.2/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index cb1fa8db..110169ec 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.2.1 \ + PLATFORMSH_CLI_VERSION=4.3.0 \ ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index b92ddd21..715eb41d 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.2.1 \ + PLATFORMSH_CLI_VERSION=4.3.0 \ ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index d7f1d91a..8c75f9ae 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.2.1 \ + PLATFORMSH_CLI_VERSION=4.3.0 \ ACQUIA_CLI_VERSION=2.8.6 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ From de4466808c39500dfb98588f3a4a9753fe8d7075 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Tue, 21 Mar 2023 08:23:04 -0700 Subject: [PATCH 23/25] updates composer 2.5.4 => 2.5.5 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 8.2/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 110169ec..099decf7 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -253,7 +253,7 @@ RUN set -xe; \ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.26 \ - COMPOSER2_VERSION=2.5.4 \ + COMPOSER2_VERSION=2.5.5 \ DRUSH_VERSION=8.4.12 \ DRUSH_LAUNCHER_VERSION=0.10.1 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 715eb41d..d9a2c5a2 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -253,7 +253,7 @@ RUN set -xe; \ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.26 \ - COMPOSER2_VERSION=2.5.4 \ + COMPOSER2_VERSION=2.5.5 \ DRUSH_VERSION=8.4.12 \ DRUSH_LAUNCHER_VERSION=0.10.1 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 8c75f9ae..27e3d39b 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -253,7 +253,7 @@ RUN set -xe; \ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.26 \ - COMPOSER2_VERSION=2.5.4 \ + COMPOSER2_VERSION=2.5.5 \ DRUSH_VERSION=8.4.12 \ DRUSH_LAUNCHER_VERSION=0.10.1 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ From 57114f3596b20fedf9e39751c296835a2ecf2303 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Fri, 24 Mar 2023 09:16:21 -0700 Subject: [PATCH 24/25] updates acquia cli 2.8.6 => 2.9.3 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 8.2/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 099decf7..a9a583f5 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.3.0 \ - ACQUIA_CLI_VERSION=2.8.6 \ + ACQUIA_CLI_VERSION=2.9.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.32.2 diff --git a/8.1/Dockerfile b/8.1/Dockerfile index d9a2c5a2..dd358a01 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.3.0 \ - ACQUIA_CLI_VERSION=2.8.6 \ + ACQUIA_CLI_VERSION=2.9.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.32.2 diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 27e3d39b..a09c9b9f 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -260,7 +260,7 @@ ENV \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ PLATFORMSH_CLI_VERSION=4.3.0 \ - ACQUIA_CLI_VERSION=2.8.6 \ + ACQUIA_CLI_VERSION=2.9.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ YQ_VERSION=4.32.2 From 7edb44fb80c26776f9307b5bf25773a012bf6975 Mon Sep 17 00:00:00 2001 From: Shelane French Date: Fri, 24 Mar 2023 09:17:00 -0700 Subject: [PATCH 25/25] updates platformsh 4.3.0 => 4.4.0 --- 8.0/Dockerfile | 2 +- 8.1/Dockerfile | 2 +- 8.2/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index a9a583f5..3be3f60f 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.3.0 \ + PLATFORMSH_CLI_VERSION=4.4.0 \ ACQUIA_CLI_VERSION=2.9.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index dd358a01..736f10db 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.3.0 \ + PLATFORMSH_CLI_VERSION=4.4.0 \ ACQUIA_CLI_VERSION=2.9.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index a09c9b9f..4566980e 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -259,7 +259,7 @@ ENV \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ WPCLI_VERSION=2.7.1 \ BLACKFIRE_VERSION=2.10.0 \ - PLATFORMSH_CLI_VERSION=4.3.0 \ + PLATFORMSH_CLI_VERSION=4.4.0 \ ACQUIA_CLI_VERSION=2.9.3 \ TERMINUS_VERSION=3.1.4 \ JQ_VERSION=1.6 \