Skip to content

Commit

Permalink
Merge pull request #116 from magento-commerce/develop
Browse files Browse the repository at this point in the history
MCLOUD-10863: Release Cloud Tools
  • Loading branch information
BaDos authored Jul 31, 2023
2 parents d6ea1af + 0e457bc commit cf95bd4
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 27 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions images/opensearch/2.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions images/opensearch/2.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions images/opensearch/2.5/docker-healthcheck.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions images/php/7.2-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions images/php/7.2-cli/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions images/php/7.3-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions images/php/7.3-cli/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions images/php/7.4-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion images/php/7.4-cli/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && \
Expand Down
6 changes: 3 additions & 3 deletions images/php/8.0-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion images/php/8.0-cli/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && \
Expand Down
6 changes: 3 additions & 3 deletions images/php/8.1-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion images/php/8.1-cli/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && \
Expand Down
7 changes: 4 additions & 3 deletions images/php/8.2-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion images/php/8.2-cli/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && \
Expand Down
1 change: 1 addition & 0 deletions images/php/8.2-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ RUN apt-get update \
libyaml-dev \
libzip-dev \
zip \
python3-yaml \
&& rm -rf /var/lib/apt/lists/*

# Install MailHog
Expand Down
6 changes: 3 additions & 3 deletions images/php/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion images/php/cli/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && \
Expand Down
3 changes: 3 additions & 0 deletions src/Command/Image/GenerateOs.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class GenerateOs extends Command
],
'2.4' => [
'real-version' => '2.4.0'
],
'2.5' => [
'real-version' => '2.5.0'
]
];

Expand Down
8 changes: 8 additions & 0 deletions src/Command/Image/GeneratePhp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down Expand Up @@ -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)
]
Expand Down

0 comments on commit cf95bd4

Please sign in to comment.