Skip to content

Commit 7df89c1

Browse files
MCLOUD-5806: Add PHP 7.4 images (#198)
1 parent 97f046e commit 7df89c1

33 files changed

+789
-15
lines changed

images/php/7.1-cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is automatically generated. Do not edit directly. #
2-
FROM php:7.1-cli-stretch
2+
FROM php:7.1-cli-buster
33
ARG GOSU_VERSION=1.11
44

55
ENV COMPOSER_MEMORY_LIMIT -1

images/php/7.1-fpm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is automatically generated. Do not edit directly. #
2-
FROM php:7.1-fpm-stretch
2+
FROM php:7.1-fpm-buster
33
ARG GOSU_VERSION=1.11
44

55
ENV PHP_MEMORY_LIMIT 2G

images/php/7.2-cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is automatically generated. Do not edit directly. #
2-
FROM php:7.2-cli-stretch
2+
FROM php:7.2-cli-buster
33
ARG GOSU_VERSION=1.11
44

55
ENV COMPOSER_MEMORY_LIMIT -1

images/php/7.2-fpm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is automatically generated. Do not edit directly. #
2-
FROM php:7.2-fpm-stretch
2+
FROM php:7.2-fpm-buster
33
ARG GOSU_VERSION=1.11
44

55
ENV PHP_MEMORY_LIMIT 2G

images/php/7.3-cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is automatically generated. Do not edit directly. #
2-
FROM php:7.3-cli-stretch
2+
FROM php:7.3-cli-buster
33
ARG GOSU_VERSION=1.11
44

55
ENV COMPOSER_MEMORY_LIMIT -1

images/php/7.3-fpm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is automatically generated. Do not edit directly. #
2-
FROM php:7.3-fpm-stretch
2+
FROM php:7.3-fpm-buster
33
ARG GOSU_VERSION=1.11
44

55
ENV PHP_MEMORY_LIMIT 2G

images/php/7.4-cli/Dockerfile

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# This file is automatically generated. Do not edit directly. #
2+
FROM php:7.4-cli-buster
3+
ARG GOSU_VERSION=1.11
4+
5+
ENV PHP_MEMORY_LIMIT 2G
6+
ENV MAGENTO_ROOT /app
7+
ENV DEBUG false
8+
ENV MAGENTO_RUN_MODE production
9+
ENV UPDATE_UID_GID false
10+
ENV COMPOSER_ALLOW_SUPERUSER 1
11+
12+
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
13+
14+
# Configure Node.js version
15+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash
16+
17+
# Install dependencies
18+
RUN apt-get update \
19+
&& apt-get upgrade -y \
20+
&& apt-get install -y --no-install-recommends \
21+
apt-utils \
22+
cron \
23+
git \
24+
mariadb-client \
25+
nano \
26+
nodejs \
27+
python3 \
28+
python3-pip \
29+
redis-tools \
30+
rsyslog \
31+
sendmail \
32+
sendmail-bin \
33+
sudo \
34+
unzip \
35+
vim \
36+
libbz2-dev \
37+
libjpeg62-turbo-dev \
38+
libpng-dev \
39+
libfreetype6-dev \
40+
libgeoip-dev \
41+
wget \
42+
libgmp-dev \
43+
libmagickwand-dev \
44+
libmagickcore-dev \
45+
libicu-dev \
46+
libldap2-dev \
47+
libpspell-dev \
48+
libtidy-dev \
49+
libxslt1-dev \
50+
libyaml-dev \
51+
libzip-dev \
52+
zip \
53+
&& rm -rf /var/lib/apt/lists/*
54+
55+
# Install PyYAML
56+
RUN pip3 install --upgrade setuptools \
57+
&& pip3 install pyyaml
58+
59+
# Install Grunt
60+
RUN npm install -g grunt-cli
61+
62+
# Configure the gd library
63+
RUN docker-php-ext-configure \
64+
gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
65+
RUN docker-php-ext-configure \
66+
ldap --with-libdir=lib/x86_64-linux-gnu
67+
RUN docker-php-ext-configure \
68+
opcache --enable-opcache
69+
70+
# Install required PHP extensions
71+
RUN docker-php-ext-install -j$(nproc) \
72+
bcmath \
73+
bz2 \
74+
calendar \
75+
exif \
76+
gd \
77+
gettext \
78+
gmp \
79+
intl \
80+
ldap \
81+
mysqli \
82+
opcache \
83+
pdo_mysql \
84+
pspell \
85+
shmop \
86+
soap \
87+
sockets \
88+
sysvmsg \
89+
sysvsem \
90+
sysvshm \
91+
tidy \
92+
xmlrpc \
93+
xsl \
94+
zip \
95+
pcntl
96+
97+
RUN pecl install -o -f \
98+
geoip-1.1.1 \
99+
igbinary \
100+
imagick \
101+
mailparse \
102+
msgpack \
103+
oauth \
104+
pcov \
105+
propro \
106+
raphf \
107+
redis \
108+
xdebug-2.9.3 \
109+
yaml
110+
111+
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
112+
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
113+
&& apt-get remove libsodium* -y \
114+
&& mkdir -p /tmp/libsodium \
115+
&& curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \
116+
&& cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \
117+
&& ./configure \
118+
&& make && make check \
119+
&& make install \
120+
&& cd / \
121+
&& rm -rf /tmp/libsodium \
122+
&& pecl install -o -f libsodium
123+
124+
RUN docker-php-ext-enable \
125+
bcmath \
126+
bz2 \
127+
calendar \
128+
exif \
129+
gd \
130+
geoip \
131+
gettext \
132+
gmp \
133+
igbinary \
134+
imagick \
135+
intl \
136+
ldap \
137+
mailparse \
138+
msgpack \
139+
mysqli \
140+
oauth \
141+
opcache \
142+
pcov \
143+
pdo_mysql \
144+
propro \
145+
pspell \
146+
raphf \
147+
redis \
148+
shmop \
149+
soap \
150+
sockets \
151+
sodium \
152+
sysvmsg \
153+
sysvsem \
154+
sysvshm \
155+
tidy \
156+
xdebug \
157+
xmlrpc \
158+
xsl \
159+
yaml \
160+
zip \
161+
pcntl
162+
163+
ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini
164+
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
165+
ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini
166+
ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini
167+
168+
# Get composer installed to /usr/local/bin/composer
169+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
170+
171+
ADD bin/* /usr/local/bin/
172+
173+
RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www
174+
175+
ADD docker-entrypoint.sh /docker-entrypoint.sh
176+
177+
RUN ["chmod", "+x", \
178+
"/docker-entrypoint.sh", \
179+
"/usr/local/bin/magento-installer", \
180+
"/usr/local/bin/magento-command", \
181+
"/usr/local/bin/mftf-command", \
182+
"/usr/local/bin/ece-command", \
183+
"/usr/local/bin/cloud-build", \
184+
"/usr/local/bin/cloud-deploy", \
185+
"/usr/local/bin/cloud-post-deploy", \
186+
"/usr/local/bin/run-cron", \
187+
"/usr/local/bin/run-hooks" \
188+
]
189+
190+
RUN mkdir -p ${MAGENTO_ROOT}
191+
192+
VOLUME ${MAGENTO_ROOT}
193+
194+
ENTRYPOINT ["/docker-entrypoint.sh"]
195+
196+
USER root
197+
198+
WORKDIR ${MAGENTO_ROOT}
199+
200+
CMD ["bash"]

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
fi
23+
24+
echo "Installing dependencies."
25+
26+
composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist
27+
28+
echo "Running \"build\" hook."
29+
30+
$RUN_HOOKS build
31+
32+
if [ "$MAGENTO_RUN_MODE" == "production" ]; then
33+
echo "Setting file permissions."
34+
35+
chown -R www:www $MAGENTO_ROOT
36+
37+
find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \;
38+
find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \;
39+
fi
40+
41+
echo "Building complete."

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
27+
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)