Skip to content

Commit c42b591

Browse files
authored
Merge pull request #126 from magento-commerce/MCLOUD-12021
Add images for OpenSearch 1.3 and 2.12
2 parents 9998e56 + 4ba9b32 commit c42b591

File tree

8 files changed

+96
-1
lines changed

8 files changed

+96
-1
lines changed

images/opensearch/1.3/Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM opensearchproject/opensearch:1.3.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/opensearch/2.12/Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM opensearchproject/opensearch:2.12.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
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

src/Command/Image/GenerateOs.php

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class GenerateOs extends Command
3434
'1.2' => [
3535
'real-version' => '1.2.1',
3636
],
37+
'1.3' => [
38+
'real-version' => '1.3.0',
39+
],
3740
'2.3' => [
3841
'real-version' => '2.3.0'
3942
],
@@ -42,6 +45,9 @@ class GenerateOs extends Command
4245
],
4346
'2.5' => [
4447
'real-version' => '2.5.0'
48+
],
49+
'2.12' => [
50+
'real-version' => '2.12.0'
4551
]
4652
];
4753

src/Test/Functional/Acceptance/Opensearch82Cest.php

-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ class Opensearch82Cest extends OpensearchCest
2020
* Template version for testing
2121
*/
2222
protected const TEMPLATE_VERSION = '2.4.6';
23-
2423
}

0 commit comments

Comments
 (0)