Skip to content

Commit ca59d43

Browse files
authored
MCLOUD-8344: Add PHP 8.1 images, upgrade xDebug and xmlrpc (#80)
1 parent e28b376 commit ca59d43

38 files changed

+670
-33
lines changed

dist/bin/magento-docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ USAGE="Magento Cloud Docker
2525
php 7.3 run a command in a PHP 7.3 container
2626
php 7.4 run a command in a PHP 7.4 container
2727
php 8.0 run a command in a PHP 8.0 container
28+
php 8.1 run a command in a PHP 8.1 container
2829
copy-to copy to container (use --all or specific file/directory)
2930
copy-from copy from container (use --all or specific file/directory)
3031
fix-owns fix ownership to www:www

images/php/7.2-cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ RUN pecl install -o -f \
131131
raphf \
132132
redis \
133133
ssh2-1.1.2 \
134-
xdebug-3.0.4 \
134+
xdebug-3.1.2 \
135135
yaml
136136

137137
RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \

images/php/7.2-fpm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ RUN pecl install -o -f \
108108
raphf \
109109
redis \
110110
ssh2-1.1.2 \
111-
xdebug-3.0.4 \
111+
xdebug-3.1.2 \
112112
yaml
113113

114114
RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \

images/php/7.3-cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ RUN pecl install -o -f \
128128
propro \
129129
raphf \
130130
redis \
131-
xdebug-3.0.4 \
131+
xdebug-3.1.2 \
132132
yaml
133133

134134
RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \

images/php/7.3-fpm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ RUN pecl install -o -f \
105105
propro \
106106
raphf \
107107
redis \
108-
xdebug-3.0.4 \
108+
xdebug-3.1.2 \
109109
yaml
110110

111111
RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \

images/php/7.4-cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ RUN pecl install -o -f \
118118
propro \
119119
raphf \
120120
redis \
121-
xdebug-3.0.4 \
121+
xdebug-3.1.2 \
122122
yaml
123123

124124
RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \

images/php/7.4-fpm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ RUN pecl install -o -f \
9595
propro \
9696
raphf \
9797
redis \
98-
xdebug-3.0.4 \
98+
xdebug-3.1.2 \
9999
yaml
100100

101101
RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \

images/php/8.0-cli/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ RUN pecl install -o -f \
110110
pcov \
111111
raphf \
112112
redis \
113-
xdebug-3.0.4 \
114-
xmlrpc-1.0.0RC2 \
113+
xdebug-3.1.2 \
114+
xmlrpc-1.0.0RC3 \
115115
yaml
116116

117117
RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \

images/php/8.0-fpm/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ RUN pecl install -o -f \
8787
pcov \
8888
raphf \
8989
redis \
90-
xdebug-3.0.4 \
91-
xmlrpc-1.0.0RC2 \
90+
xdebug-3.1.2 \
91+
xmlrpc-1.0.0RC3 \
9292
yaml
9393

9494
RUN curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \

images/php/8.1-cli/Dockerfile

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

0 commit comments

Comments
 (0)