diff --git a/composer.json b/composer.json index dff91e7a..95eeda60 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.3.5", + "version": "1.3.6", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/images/opensearch/2.5/Dockerfile b/images/opensearch/2.5/Dockerfile new file mode 100644 index 00000000..a1b197fa --- /dev/null +++ b/images/opensearch/2.5/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:2.5.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/2.5/docker-entrypoint.sh b/images/opensearch/2.5/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.5/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/2.5/docker-healthcheck.sh b/images/opensearch/2.5/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.5/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/images/php/7.2-cli/Dockerfile b/images/php/7.2-cli/Dockerfile index d474c800..712c1f95 100644 --- a/images/php/7.2-cli/Dockerfile +++ b/images/php/7.2-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false @@ -82,9 +83,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/7.2-cli/docker-entrypoint.sh b/images/php/7.2-cli/docker-entrypoint.sh index 1e025ca7..ee380b80 100644 --- a/images/php/7.2-cli/docker-entrypoint.sh +++ b/images/php/7.2-cli/docker-entrypoint.sh @@ -17,6 +17,10 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ composer self-update $COMPOSER_VERSION diff --git a/images/php/7.3-cli/Dockerfile b/images/php/7.3-cli/Dockerfile index 065b9b45..0cc15df7 100644 --- a/images/php/7.3-cli/Dockerfile +++ b/images/php/7.3-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false @@ -80,9 +81,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/7.3-cli/docker-entrypoint.sh b/images/php/7.3-cli/docker-entrypoint.sh index 1e025ca7..ee380b80 100644 --- a/images/php/7.3-cli/docker-entrypoint.sh +++ b/images/php/7.3-cli/docker-entrypoint.sh @@ -17,6 +17,10 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ composer self-update $COMPOSER_VERSION diff --git a/images/php/7.4-cli/Dockerfile b/images/php/7.4-cli/Dockerfile index 108426f4..949519b7 100644 --- a/images/php/7.4-cli/Dockerfile +++ b/images/php/7.4-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false @@ -76,9 +77,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/7.4-cli/docker-entrypoint.sh b/images/php/7.4-cli/docker-entrypoint.sh index f26def5d..ee380b80 100644 --- a/images/php/7.4-cli/docker-entrypoint.sh +++ b/images/php/7.4-cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index e00a862f..45dd71d1 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false @@ -73,9 +74,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/8.0-cli/docker-entrypoint.sh b/images/php/8.0-cli/docker-entrypoint.sh index f26def5d..ee380b80 100644 --- a/images/php/8.0-cli/docker-entrypoint.sh +++ b/images/php/8.0-cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 651f17d9..99010a5f 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false @@ -73,9 +74,8 @@ RUN apt-get update \ zip \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/8.1-cli/docker-entrypoint.sh b/images/php/8.1-cli/docker-entrypoint.sh index f26def5d..ee380b80 100644 --- a/images/php/8.1-cli/docker-entrypoint.sh +++ b/images/php/8.1-cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index f5bebb6a..dbafd471 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false @@ -71,11 +72,11 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages + # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/8.2-cli/docker-entrypoint.sh b/images/php/8.2-cli/docker-entrypoint.sh index f26def5d..ee380b80 100644 --- a/images/php/8.2-cli/docker-entrypoint.sh +++ b/images/php/8.2-cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.2-fpm/Dockerfile b/images/php/8.2-fpm/Dockerfile index 7ae884d7..de75c9a5 100644 --- a/images/php/8.2-fpm/Dockerfile +++ b/images/php/8.2-fpm/Dockerfile @@ -53,6 +53,7 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install MailHog diff --git a/images/php/cli/Dockerfile b/images/php/cli/Dockerfile index b793da07..f42d1d1b 100755 --- a/images/php/cli/Dockerfile +++ b/images/php/cli/Dockerfile @@ -21,6 +21,7 @@ ARG CRONTAB="" ENV COMPOSER_MEMORY_LIMIT -1 ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false ENV PHP_MEMORY_LIMIT -1 ENV PHP_VALIDATE_TIMESTAMPS 1 ENV DEBUG false @@ -40,9 +41,8 @@ RUN apt-get update \ {%packages%} \ && rm -rf /var/lib/apt/lists/* -# Install PyYAML -RUN pip3 install --upgrade setuptools \ - && pip3 install pyyaml +# Install Python packages +{%python_packages%} # Install Grunt RUN npm install -g grunt-cli diff --git a/images/php/cli/docker-entrypoint.sh b/images/php/cli/docker-entrypoint.sh index f26def5d..ee380b80 100755 --- a/images/php/cli/docker-entrypoint.sh +++ b/images/php/cli/docker-entrypoint.sh @@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} fi +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ - composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/src/Command/Image/GenerateOs.php b/src/Command/Image/GenerateOs.php index f2ebefab..2b71aabe 100644 --- a/src/Command/Image/GenerateOs.php +++ b/src/Command/Image/GenerateOs.php @@ -39,6 +39,9 @@ class GenerateOs extends Command ], '2.4' => [ 'real-version' => '2.4.0' + ], + '2.5' => [ + 'real-version' => '2.5.0' ] ]; diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index e33e4c33..238b3052 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -286,6 +286,13 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } } + if ($this->semver::satisfies($phpVersion, '8.2.*')) { + $packages[] = 'python3-yaml'; + $pythonPackages = ''; + } else { + $pythonPackages = 'RUN pip3 install --upgrade setuptools && pip3 install pyyaml'; + } + $volumes = [ 'root' => [ 'def' => 'VOLUME ${MAGENTO_ROOT}', @@ -319,6 +326,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string '{%env_php_extensions%}' => $phpExtEnabledDefault ? 'ENV PHP_EXTENSIONS ' . implode(' ', $phpExtEnabledDefault) : '', + '{%python_packages%}' => $pythonPackages, '{%volumes_cmd%}' => rtrim($volumesCmd), '{%volumes_def%}' => rtrim($volumesDef) ]