Skip to content

Commit cf95bd4

Browse files
authored
Merge pull request #116 from magento-commerce/develop
MCLOUD-10863: Release Cloud Tools
2 parents d6ea1af + 0e457bc commit cf95bd4

21 files changed

+108
-27
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento-cloud-docker",
33
"description": "Magento Cloud Docker",
44
"type": "magento2-component",
5-
"version": "1.3.5",
5+
"version": "1.3.6",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"

images/opensearch/2.5/Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM opensearchproject/opensearch:2.5.0
2+
3+
USER root
4+
RUN yum -y install zip && \
5+
zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \
6+
yum remove -y zip && \
7+
yum -y clean all && \
8+
rm -rf /var/cache
9+
USER opensearch
10+
11+
RUN bin/opensearch-plugin install -b analysis-icu && \
12+
bin/opensearch-plugin install -b analysis-phonetic
13+
14+
ADD docker-healthcheck.sh /docker-healthcheck.sh
15+
ADD docker-entrypoint.sh /docker-entrypoint.sh
16+
17+
HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"]
18+
19+
ENTRYPOINT ["/docker-entrypoint.sh"]
20+
21+
EXPOSE 9200 9300
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
if [[ -n "$OS_PLUGINS" ]]; then
5+
echo "Installing plugins: $OS_PLUGINS"
6+
for PLUGIN in $OS_PLUGINS
7+
do
8+
./bin/opensearch-plugin install -b "$PLUGIN"
9+
done
10+
fi
11+
12+
/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then
5+
health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ")
6+
if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then
7+
exit 0
8+
fi
9+
echo >&2 "Unexpected health status: $health"
10+
fi
11+
12+
exit 1

images/php/7.2-cli/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ARG CRONTAB=""
2121
ENV COMPOSER_MEMORY_LIMIT -1
2222
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
2323
ENV COMPOSER_HOME ${COMPOSER_HOME}
24+
ENV COMPOSER_CLEAR_CACHE false
2425
ENV PHP_MEMORY_LIMIT -1
2526
ENV PHP_VALIDATE_TIMESTAMPS 1
2627
ENV DEBUG false
@@ -82,9 +83,8 @@ RUN apt-get update \
8283
zip \
8384
&& rm -rf /var/lib/apt/lists/*
8485

85-
# Install PyYAML
86-
RUN pip3 install --upgrade setuptools \
87-
&& pip3 install pyyaml
86+
# Install Python packages
87+
RUN pip3 install --upgrade setuptools && pip3 install pyyaml
8888

8989
# Install Grunt
9090
RUN npm install -g grunt-cli

images/php/7.2-cli/docker-entrypoint.sh

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
1717
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
1818
fi
1919

20+
# Clear composer cache if needed
21+
[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \
22+
composer clearcache
23+
2024
# Configure composer
2125
[ ! -z "${COMPOSER_VERSION}" ] && \
2226
composer self-update $COMPOSER_VERSION

images/php/7.3-cli/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ARG CRONTAB=""
2121
ENV COMPOSER_MEMORY_LIMIT -1
2222
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
2323
ENV COMPOSER_HOME ${COMPOSER_HOME}
24+
ENV COMPOSER_CLEAR_CACHE false
2425
ENV PHP_MEMORY_LIMIT -1
2526
ENV PHP_VALIDATE_TIMESTAMPS 1
2627
ENV DEBUG false
@@ -80,9 +81,8 @@ RUN apt-get update \
8081
zip \
8182
&& rm -rf /var/lib/apt/lists/*
8283

83-
# Install PyYAML
84-
RUN pip3 install --upgrade setuptools \
85-
&& pip3 install pyyaml
84+
# Install Python packages
85+
RUN pip3 install --upgrade setuptools && pip3 install pyyaml
8686

8787
# Install Grunt
8888
RUN npm install -g grunt-cli

images/php/7.3-cli/docker-entrypoint.sh

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
1717
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
1818
fi
1919

20+
# Clear composer cache if needed
21+
[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \
22+
composer clearcache
23+
2024
# Configure composer
2125
[ ! -z "${COMPOSER_VERSION}" ] && \
2226
composer self-update $COMPOSER_VERSION

images/php/7.4-cli/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ARG CRONTAB=""
2121
ENV COMPOSER_MEMORY_LIMIT -1
2222
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
2323
ENV COMPOSER_HOME ${COMPOSER_HOME}
24+
ENV COMPOSER_CLEAR_CACHE false
2425
ENV PHP_MEMORY_LIMIT -1
2526
ENV PHP_VALIDATE_TIMESTAMPS 1
2627
ENV DEBUG false
@@ -76,9 +77,8 @@ RUN apt-get update \
7677
zip \
7778
&& rm -rf /var/lib/apt/lists/*
7879

79-
# Install PyYAML
80-
RUN pip3 install --upgrade setuptools \
81-
&& pip3 install pyyaml
80+
# Install Python packages
81+
RUN pip3 install --upgrade setuptools && pip3 install pyyaml
8282

8383
# Install Grunt
8484
RUN npm install -g grunt-cli

images/php/7.4-cli/docker-entrypoint.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
1717
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
1818
fi
1919

20+
# Clear composer cache if needed
21+
[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \
22+
composer clearcache
23+
2024
# Configure composer
2125
[ ! -z "${COMPOSER_VERSION}" ] && \
22-
composer clearcache && \
2326
composer self-update $COMPOSER_VERSION
2427

2528
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \

images/php/8.0-cli/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ARG CRONTAB=""
2121
ENV COMPOSER_MEMORY_LIMIT -1
2222
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
2323
ENV COMPOSER_HOME ${COMPOSER_HOME}
24+
ENV COMPOSER_CLEAR_CACHE false
2425
ENV PHP_MEMORY_LIMIT -1
2526
ENV PHP_VALIDATE_TIMESTAMPS 1
2627
ENV DEBUG false
@@ -73,9 +74,8 @@ RUN apt-get update \
7374
zip \
7475
&& rm -rf /var/lib/apt/lists/*
7576

76-
# Install PyYAML
77-
RUN pip3 install --upgrade setuptools \
78-
&& pip3 install pyyaml
77+
# Install Python packages
78+
RUN pip3 install --upgrade setuptools && pip3 install pyyaml
7979

8080
# Install Grunt
8181
RUN npm install -g grunt-cli

images/php/8.0-cli/docker-entrypoint.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
1717
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
1818
fi
1919

20+
# Clear composer cache if needed
21+
[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \
22+
composer clearcache
23+
2024
# Configure composer
2125
[ ! -z "${COMPOSER_VERSION}" ] && \
22-
composer clearcache && \
2326
composer self-update $COMPOSER_VERSION
2427

2528
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \

images/php/8.1-cli/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ARG CRONTAB=""
2121
ENV COMPOSER_MEMORY_LIMIT -1
2222
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
2323
ENV COMPOSER_HOME ${COMPOSER_HOME}
24+
ENV COMPOSER_CLEAR_CACHE false
2425
ENV PHP_MEMORY_LIMIT -1
2526
ENV PHP_VALIDATE_TIMESTAMPS 1
2627
ENV DEBUG false
@@ -73,9 +74,8 @@ RUN apt-get update \
7374
zip \
7475
&& rm -rf /var/lib/apt/lists/*
7576

76-
# Install PyYAML
77-
RUN pip3 install --upgrade setuptools \
78-
&& pip3 install pyyaml
77+
# Install Python packages
78+
RUN pip3 install --upgrade setuptools && pip3 install pyyaml
7979

8080
# Install Grunt
8181
RUN npm install -g grunt-cli

images/php/8.1-cli/docker-entrypoint.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
1717
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
1818
fi
1919

20+
# Clear composer cache if needed
21+
[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \
22+
composer clearcache
23+
2024
# Configure composer
2125
[ ! -z "${COMPOSER_VERSION}" ] && \
22-
composer clearcache && \
2326
composer self-update $COMPOSER_VERSION
2427

2528
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \

images/php/8.2-cli/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ARG CRONTAB=""
2121
ENV COMPOSER_MEMORY_LIMIT -1
2222
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
2323
ENV COMPOSER_HOME ${COMPOSER_HOME}
24+
ENV COMPOSER_CLEAR_CACHE false
2425
ENV PHP_MEMORY_LIMIT -1
2526
ENV PHP_VALIDATE_TIMESTAMPS 1
2627
ENV DEBUG false
@@ -71,11 +72,11 @@ RUN apt-get update \
7172
libyaml-dev \
7273
libzip-dev \
7374
zip \
75+
python3-yaml \
7476
&& rm -rf /var/lib/apt/lists/*
7577

76-
# Install PyYAML
77-
RUN pip3 install --upgrade setuptools \
78-
&& pip3 install pyyaml
78+
# Install Python packages
79+
7980

8081
# Install Grunt
8182
RUN npm install -g grunt-cli

images/php/8.2-cli/docker-entrypoint.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
1717
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
1818
fi
1919

20+
# Clear composer cache if needed
21+
[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \
22+
composer clearcache
23+
2024
# Configure composer
2125
[ ! -z "${COMPOSER_VERSION}" ] && \
22-
composer clearcache && \
2326
composer self-update $COMPOSER_VERSION
2427

2528
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \

images/php/8.2-fpm/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ RUN apt-get update \
5353
libyaml-dev \
5454
libzip-dev \
5555
zip \
56+
python3-yaml \
5657
&& rm -rf /var/lib/apt/lists/*
5758

5859
# Install MailHog

images/php/cli/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ARG CRONTAB=""
2121
ENV COMPOSER_MEMORY_LIMIT -1
2222
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
2323
ENV COMPOSER_HOME ${COMPOSER_HOME}
24+
ENV COMPOSER_CLEAR_CACHE false
2425
ENV PHP_MEMORY_LIMIT -1
2526
ENV PHP_VALIDATE_TIMESTAMPS 1
2627
ENV DEBUG false
@@ -40,9 +41,8 @@ RUN apt-get update \
4041
{%packages%} \
4142
&& rm -rf /var/lib/apt/lists/*
4243

43-
# Install PyYAML
44-
RUN pip3 install --upgrade setuptools \
45-
&& pip3 install pyyaml
44+
# Install Python packages
45+
{%python_packages%}
4646

4747
# Install Grunt
4848
RUN npm install -g grunt-cli

images/php/cli/docker-entrypoint.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; the
1717
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
1818
fi
1919

20+
# Clear composer cache if needed
21+
[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \
22+
composer clearcache
23+
2024
# Configure composer
2125
[ ! -z "${COMPOSER_VERSION}" ] && \
22-
composer clearcache && \
2326
composer self-update $COMPOSER_VERSION
2427

2528
[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \

src/Command/Image/GenerateOs.php

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class GenerateOs extends Command
3939
],
4040
'2.4' => [
4141
'real-version' => '2.4.0'
42+
],
43+
'2.5' => [
44+
'real-version' => '2.5.0'
4245
]
4346
];
4447

src/Command/Image/GeneratePhp.php

+8
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string
286286
}
287287
}
288288

289+
if ($this->semver::satisfies($phpVersion, '8.2.*')) {
290+
$packages[] = 'python3-yaml';
291+
$pythonPackages = '';
292+
} else {
293+
$pythonPackages = 'RUN pip3 install --upgrade setuptools && pip3 install pyyaml';
294+
}
295+
289296
$volumes = [
290297
'root' => [
291298
'def' => 'VOLUME ${MAGENTO_ROOT}',
@@ -319,6 +326,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string
319326
'{%env_php_extensions%}' => $phpExtEnabledDefault
320327
? 'ENV PHP_EXTENSIONS ' . implode(' ', $phpExtEnabledDefault)
321328
: '',
329+
'{%python_packages%}' => $pythonPackages,
322330
'{%volumes_cmd%}' => rtrim($volumesCmd),
323331
'{%volumes_def%}' => rtrim($volumesDef)
324332
]

0 commit comments

Comments
 (0)