Skip to content

Commit 5094270

Browse files
authored
MCLOUD-9738: Adding images for new service versions. (#105)
1 parent 747d353 commit 5094270

35 files changed

+949
-7
lines changed

images/opensearch/2.3/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM opensearchproject/opensearch:2.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
Lines changed: 12 additions & 0 deletions
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
Lines changed: 12 additions & 0 deletions
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.4/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM opensearchproject/opensearch:2.4.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
Lines changed: 12 additions & 0 deletions
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
Lines changed: 12 additions & 0 deletions
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/8.2-cli/Dockerfile

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# This file is automatically generated. Do not edit directly. #
2+
FROM golang:1.15 AS builder
3+
4+
RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \
5+
&& wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \
6+
&& tar -xf mhsendmail.tar.gz \
7+
&& mkdir -p ./src/github.com/mailhog/ \
8+
&& mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \
9+
&& cd ./src/github.com/mailhog/mhsendmail/ \
10+
&& go get . \
11+
&& GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail .
12+
13+
FROM php:8.2-cli
14+
15+
ARG COMPOSER_VERSION=2.2.18
16+
ARG MAGENTO_ROOT=/app
17+
ARG COMPOSER_ALLOW_SUPERUSER=1
18+
ARG COMPOSER_HOME=/composer
19+
ARG CRONTAB=""
20+
21+
ENV COMPOSER_MEMORY_LIMIT -1
22+
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
23+
ENV COMPOSER_HOME ${COMPOSER_HOME}
24+
ENV PHP_MEMORY_LIMIT -1
25+
ENV PHP_VALIDATE_TIMESTAMPS 1
26+
ENV DEBUG false
27+
ENV MAGENTO_RUN_MODE production
28+
ENV SENDMAIL_PATH /dev/null
29+
ENV PHPRC ${MAGENTO_ROOT}/php.ini
30+
31+
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl
32+
33+
# Configure Node.js version
34+
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash
35+
36+
# Install dependencies
37+
RUN apt-get update \
38+
&& apt-get upgrade -y \
39+
&& apt-get install -y --no-install-recommends \
40+
apt-utils \
41+
cron \
42+
git \
43+
mariadb-client \
44+
nano \
45+
nodejs \
46+
python3 \
47+
python3-pip \
48+
redis-tools \
49+
sendmail-bin \
50+
sendmail \
51+
sudo \
52+
unzip \
53+
vim \
54+
openssh-client \
55+
gnupg2 \
56+
ca-certificates \
57+
lsb-release \
58+
software-properties-common \
59+
libbz2-dev \
60+
libjpeg62-turbo-dev \
61+
libpng-dev \
62+
libfreetype6-dev \
63+
libgmp-dev \
64+
libgpgme11-dev \
65+
libicu-dev \
66+
libldap2-dev \
67+
libpcre3-dev \
68+
libpspell-dev \
69+
libtidy-dev \
70+
libxslt1-dev \
71+
libyaml-dev \
72+
libzip-dev \
73+
zip \
74+
&& rm -rf /var/lib/apt/lists/*
75+
76+
# Install PyYAML
77+
RUN pip3 install --upgrade setuptools \
78+
&& pip3 install pyyaml
79+
80+
# Install Grunt
81+
RUN npm install -g grunt-cli
82+
83+
# Install MailHog
84+
COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/
85+
RUN sudo chmod +x /usr/local/bin/mhsendmail
86+
87+
# Configure the gd library
88+
RUN docker-php-ext-configure \
89+
gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
90+
RUN docker-php-ext-configure \
91+
opcache --enable-opcache
92+
93+
# Install required PHP extensions
94+
RUN docker-php-ext-install -j$(nproc) \
95+
bcmath \
96+
bz2 \
97+
calendar \
98+
exif \
99+
gd \
100+
gettext \
101+
gmp \
102+
intl \
103+
mysqli \
104+
opcache \
105+
pdo_mysql \
106+
pspell \
107+
shmop \
108+
soap \
109+
sockets \
110+
sysvmsg \
111+
sysvsem \
112+
sysvshm \
113+
tidy \
114+
xsl \
115+
zip \
116+
pcntl
117+
118+
RUN pecl install -o -f \
119+
gnupg \
120+
mailparse \
121+
msgpack \
122+
oauth \
123+
pcov \
124+
raphf \
125+
redis \
126+
xdebug-3.2.0 \
127+
xmlrpc-1.0.0RC3 \
128+
yaml
129+
130+
RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \
131+
&& install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \
132+
&& echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \
133+
&& apt-get update \
134+
&& apt-get install blackfire-php \
135+
&& rm -rf /var/lib/apt/lists/*
136+
RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \
137+
&& docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch}
138+
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
139+
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
140+
&& apt-get remove libsodium* -y \
141+
&& mkdir -p /tmp/libsodium \
142+
&& curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \
143+
&& cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \
144+
&& ./configure \
145+
&& make && make check \
146+
&& make install \
147+
&& cd / \
148+
&& rm -rf /tmp/libsodium \
149+
&& pecl install -o -f libsodium
150+
151+
ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini
152+
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
153+
ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini
154+
ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini
155+
ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini
156+
157+
# Get composer installed to /usr/local/bin/composer
158+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer
159+
160+
ADD bin/* /usr/local/bin/
161+
162+
RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www
163+
164+
ADD docker-entrypoint.sh /docker-entrypoint.sh
165+
166+
RUN ["chmod", "+x", \
167+
"/docker-entrypoint.sh", \
168+
"/usr/local/bin/magento-installer", \
169+
"/usr/local/bin/magento-command", \
170+
"/usr/local/bin/mftf-command", \
171+
"/usr/local/bin/ece-command", \
172+
"/usr/local/bin/cloud-build", \
173+
"/usr/local/bin/cloud-deploy", \
174+
"/usr/local/bin/cloud-post-deploy", \
175+
"/usr/local/bin/run-cron", \
176+
"/usr/local/bin/run-hooks" \
177+
]
178+
179+
RUN mkdir -p ${MAGENTO_ROOT}
180+
181+
VOLUME ${MAGENTO_ROOT}
182+
183+
RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME}
184+
RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi
185+
186+
ENTRYPOINT ["/docker-entrypoint.sh"]
187+
188+
WORKDIR ${MAGENTO_ROOT}
189+
190+
USER root
191+
192+
CMD ["bash"]

images/php/8.2-cli/bin/cloud-build

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
[ "$DEBUG" = "true" ] && set -x
6+
7+
RUN_HOOKS="run-hooks"
8+
9+
if [ "$MAGENTO_RUN_MODE" == "production" ]; then
10+
echo "Cleaning directories:"
11+
12+
if [ "$INSTALLATION_TYPE" == "composer" ]; then
13+
echo "Cleaning setup directory."
14+
rm -rf $MAGENTO_ROOT/setup/*
15+
fi
16+
17+
echo "Cleaning vendor directory."
18+
rm -rf $MAGENTO_ROOT/vendor/*
19+
20+
echo "Cleaning generated directory."
21+
rm -rf $MAGENTO_ROOT/generated/*
22+
23+
echo "Removing app/etc/env.php file"
24+
rm -f $MAGENTO_ROOT/app/etc/env.php
25+
fi
26+
27+
echo "Installing dependencies."
28+
29+
composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist
30+
31+
echo "Running \"build\" hook."
32+
33+
$RUN_HOOKS build
34+
35+
if [ "$MAGENTO_RUN_MODE" == "production" ]; then
36+
echo "Setting file permissions."
37+
38+
chown -R www:www $MAGENTO_ROOT
39+
40+
find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \;
41+
find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \;
42+
fi
43+
44+
echo "Building complete."

images/php/8.2-cli/bin/cloud-deploy

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
[ "$DEBUG" = "true" ] && set -x
6+
7+
echo "Running \"deploy\" hook."
8+
9+
run-hooks deploy
10+
11+
# check that Varnish exists
12+
if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then
13+
minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/")
14+
if [[ "$minor_magento_version" != "2.1" ]]; then
15+
output=$(magento-command config:set system/full_page_cache/caching_application 2)
16+
# as config:set does not return error code, we check output text to continue set varnish settings
17+
if [[ $output == *"Value was saved"* ]]; then
18+
echo "Setting Varnish for Magento FPC."
19+
magento-command setup:config:set --http-cache-hosts=varnish -n
20+
else
21+
echo $output
22+
fi
23+
fi
24+
fi
25+
26+
# set developer mode if it is configured in $MAGENTO_RUN_MODE
27+
if [ "$MAGENTO_RUN_MODE" == "developer" ]; then
28+
output=$(magento-command deploy:mode:set developer)
29+
if [[ $output == *"Enabled developer mode."* ]]; then
30+
echo "Enabled developer mode."
31+
else
32+
echo $output
33+
fi
34+
fi
35+
36+
37+
echo "Deployment finished."
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
[ "$DEBUG" = "true" ] && set -x
6+
7+
echo "Running \"post-deploy\" hook."
8+
9+
run-hooks post_deploy
10+
11+
echo "Post deployment finished."

0 commit comments

Comments
 (0)