Skip to content

Commit 9d84dcf

Browse files
authored
Merge pull request magento#98 from magento-commerce/develop
MCLOUD-9275: Cloud Tools Release
2 parents 1d4bd41 + 71bd086 commit 9d84dcf

File tree

38 files changed

+429
-212
lines changed

38 files changed

+429
-212
lines changed

bin/init-docker.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,20 @@ parse_bool_flag()
3838
esac
3939
}
4040

41-
version_is_valid()
41+
php_version_is_valid()
4242
{
4343
if [[ ! $OPTARG =~ ^[0-9]+\.[0-9]+$ ]]; then
4444
die "Invalid version number $OPTARG for $OPT"
4545
fi
4646
}
4747

48+
image_version_is_valid()
49+
{
50+
if [[ ! $OPTARG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
51+
die "Invalid version number $OPTARG for $OPT"
52+
fi
53+
}
54+
4855
domain_is_valid()
4956
{
5057
# Check that a flag isn't being interpreted as the domain
@@ -70,7 +77,7 @@ add_host()
7077
}
7178

7279
PHP_VERSION="7.4"
73-
IMAGE_VERSION="1.2.1"
80+
IMAGE_VERSION="1.3.2"
7481
ADD_HOST=true
7582
DOMAIN="magento2.docker"
7683
USAGE="Init Docker
@@ -100,13 +107,13 @@ while getopts "hp:i:-:" OPT; do
100107
case "$OPT" in
101108
p | php )
102109
needs_arg "$@"
103-
version_is_valid
110+
php_version_is_valid
104111
PHP_VERSION="$OPTARG"
105112
;;
106113

107114
i | image )
108115
needs_arg "$@"
109-
version_is_valid
116+
image_version_is_valid
110117
IMAGE_VERSION="$OPTARG"
111118
;;
112119

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.2",
5+
"version": "1.3.3",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"

images/mailhog/1.0/Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# MailHog Dockerfile
3+
#
4+
5+
FROM golang:1.17.9-alpine
6+
7+
# Install MailHog:
8+
RUN apk --no-cache add --virtual build-dependencies \
9+
git \
10+
&& mkdir -p /root/gocode \
11+
&& export GOPATH=/root/gocode \
12+
&& go get github.com/mailhog/[email protected] \
13+
&& mv /root/gocode/bin/MailHog /usr/local/bin \
14+
&& rm -rf /root/gocode \
15+
&& apk del --purge build-dependencies
16+
17+
# Add mailhog user/group with uid/gid 1000.
18+
# This is a workaround for boot2docker issue #581, see
19+
# https://github.com/boot2docker/boot2docker/issues/581
20+
RUN adduser -D -u 1000 mailhog
21+
22+
USER mailhog
23+
24+
WORKDIR /home/mailhog
25+
26+
ENTRYPOINT ["MailHog"]
27+
28+
# Expose the SMTP and HTTP ports:
29+
EXPOSE 1025 8025

images/php/7.2-cli/Dockerfile

+30-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# 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+
213
FROM php:7.2-cli
314

415
ARG COMPOSER_VERSION=1.10.22
@@ -41,6 +52,10 @@ RUN apt-get update \
4152
unzip \
4253
vim \
4354
openssh-client \
55+
gnupg2 \
56+
ca-certificates \
57+
lsb-release \
58+
software-properties-common \
4459
libbz2-dev \
4560
libjpeg62-turbo-dev \
4661
libpng-dev \
@@ -75,17 +90,14 @@ RUN pip3 install --upgrade setuptools \
7590
RUN npm install -g grunt-cli
7691

7792
# Install MailHog
78-
RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \
79-
&& sudo chmod +x mhsendmail_linux_amd64 \
80-
&& sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail
93+
COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/
94+
RUN sudo chmod +x /usr/local/bin/mhsendmail
8195

8296
# Configure the gd library
8397
RUN docker-php-ext-configure \
8498
gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
8599
RUN docker-php-ext-configure \
86100
imap --with-kerberos --with-imap-ssl
87-
RUN docker-php-ext-configure \
88-
ldap --with-libdir=lib/x86_64-linux-gnu
89101
RUN docker-php-ext-configure \
90102
opcache --enable-opcache
91103
RUN docker-php-ext-configure \
@@ -102,7 +114,6 @@ RUN docker-php-ext-install -j$(nproc) \
102114
gmp \
103115
imap \
104116
intl \
105-
ldap \
106117
mysqli \
107118
opcache \
108119
pdo_mysql \
@@ -136,12 +147,14 @@ RUN pecl install -o -f \
136147
xdebug-3.1.2 \
137148
yaml
138149

139-
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;") \
140-
&& mkdir -p /tmp/blackfire \
141-
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
142-
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
143-
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
144-
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
150+
RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \
151+
&& install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \
152+
&& echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \
153+
&& apt-get update \
154+
&& apt-get install blackfire-php \
155+
&& rm -rf /var/lib/apt/lists/*
156+
RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \
157+
&& docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch}
145158
RUN mkdir -p /tmp/zoo \
146159
&& cd /tmp/zoo \
147160
&& git clone https://github.com/php-zookeeper/php-zookeeper.git \
@@ -172,13 +185,14 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
172185
&& rm -rf /tmp/libsodium \
173186
&& pecl install -o -f libsodium
174187
RUN cd /tmp \
175-
&& curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \
176-
&& tar zxvf ioncube_loaders_lin_x86-64.tar.gz \
188+
&& if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \
189+
&& curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \
190+
&& tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \
177191
&& export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \
178192
&& export PHP_EXT_DIR=$(php-config --extension-dir) \
179193
&& cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \
180194
&& rm -rf ./ioncube \
181-
&& rm ioncube_loaders_lin_x86-64.tar.gz
195+
&& rm ioncube_loaders_lin_${ioncube_arch}.tar.gz
182196

183197
ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini
184198
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
@@ -213,7 +227,7 @@ RUN mkdir -p ${MAGENTO_ROOT}
213227
VOLUME ${MAGENTO_ROOT}
214228

215229
RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME}
216-
RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi
230+
RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi
217231

218232
ENTRYPOINT ["/docker-entrypoint.sh"]
219233

images/php/7.2-fpm/Dockerfile

+29-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# 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+
213
FROM php:7.2-fpm
314

415
ARG MAGENTO_ROOT=/app
@@ -23,6 +34,10 @@ RUN apt-get update \
2334
sudo \
2435
iproute2 \
2536
git \
37+
gnupg2 \
38+
ca-certificates \
39+
lsb-release \
40+
software-properties-common \
2641
libbz2-dev \
2742
libjpeg62-turbo-dev \
2843
libpng-dev \
@@ -50,17 +65,14 @@ RUN apt-get update \
5065
&& rm -rf /var/lib/apt/lists/*
5166

5267
# Install MailHog
53-
RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \
54-
&& sudo chmod +x mhsendmail_linux_amd64 \
55-
&& sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail
68+
COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/
69+
RUN sudo chmod +x /usr/local/bin/mhsendmail
5670

5771
# Configure the gd library
5872
RUN docker-php-ext-configure \
5973
gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
6074
RUN docker-php-ext-configure \
6175
imap --with-kerberos --with-imap-ssl
62-
RUN docker-php-ext-configure \
63-
ldap --with-libdir=lib/x86_64-linux-gnu
6476
RUN docker-php-ext-configure \
6577
opcache --enable-opcache
6678
RUN docker-php-ext-configure \
@@ -77,7 +89,6 @@ RUN docker-php-ext-install -j$(nproc) \
7789
gmp \
7890
imap \
7991
intl \
80-
ldap \
8192
mysqli \
8293
opcache \
8394
pdo_mysql \
@@ -111,12 +122,14 @@ RUN pecl install -o -f \
111122
xdebug-3.1.2 \
112123
yaml
113124

114-
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;") \
115-
&& mkdir -p /tmp/blackfire \
116-
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
117-
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
118-
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
119-
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
125+
RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \
126+
&& install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \
127+
&& echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \
128+
&& apt-get update \
129+
&& apt-get install blackfire-php \
130+
&& rm -rf /var/lib/apt/lists/*
131+
RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \
132+
&& docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch}
120133
RUN mkdir -p /tmp/zoo \
121134
&& cd /tmp/zoo \
122135
&& git clone https://github.com/php-zookeeper/php-zookeeper.git \
@@ -147,13 +160,14 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
147160
&& rm -rf /tmp/libsodium \
148161
&& pecl install -o -f libsodium
149162
RUN cd /tmp \
150-
&& curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \
151-
&& tar zxvf ioncube_loaders_lin_x86-64.tar.gz \
163+
&& if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \
164+
&& curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \
165+
&& tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \
152166
&& export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \
153167
&& export PHP_EXT_DIR=$(php-config --extension-dir) \
154168
&& cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \
155169
&& rm -rf ./ioncube \
156-
&& rm ioncube_loaders_lin_x86-64.tar.gz
170+
&& rm ioncube_loaders_lin_${ioncube_arch}.tar.gz
157171

158172
COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini
159173
COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini

images/php/7.3-cli/Dockerfile

+30-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# 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+
213
FROM php:7.3-cli
314

415
ARG COMPOSER_VERSION=1.10.22
@@ -41,6 +52,10 @@ RUN apt-get update \
4152
unzip \
4253
vim \
4354
openssh-client \
55+
gnupg2 \
56+
ca-certificates \
57+
lsb-release \
58+
software-properties-common \
4459
libbz2-dev \
4560
libjpeg62-turbo-dev \
4661
libpng-dev \
@@ -73,17 +88,14 @@ RUN pip3 install --upgrade setuptools \
7388
RUN npm install -g grunt-cli
7489

7590
# Install MailHog
76-
RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \
77-
&& sudo chmod +x mhsendmail_linux_amd64 \
78-
&& sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail
91+
COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/
92+
RUN sudo chmod +x /usr/local/bin/mhsendmail
7993

8094
# Configure the gd library
8195
RUN docker-php-ext-configure \
8296
gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
8397
RUN docker-php-ext-configure \
8498
imap --with-kerberos --with-imap-ssl
85-
RUN docker-php-ext-configure \
86-
ldap --with-libdir=lib/x86_64-linux-gnu
8799
RUN docker-php-ext-configure \
88100
opcache --enable-opcache
89101
RUN docker-php-ext-configure \
@@ -100,7 +112,6 @@ RUN docker-php-ext-install -j$(nproc) \
100112
gmp \
101113
imap \
102114
intl \
103-
ldap \
104115
mysqli \
105116
opcache \
106117
pdo_mysql \
@@ -133,12 +144,14 @@ RUN pecl install -o -f \
133144
xdebug-3.1.2 \
134145
yaml
135146

136-
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;") \
137-
&& mkdir -p /tmp/blackfire \
138-
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
139-
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
140-
&& echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \
141-
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
147+
RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \
148+
&& install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \
149+
&& echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \
150+
&& apt-get update \
151+
&& apt-get install blackfire-php \
152+
&& rm -rf /var/lib/apt/lists/*
153+
RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \
154+
&& docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch}
142155
RUN mkdir -p /tmp/zoo \
143156
&& cd /tmp/zoo \
144157
&& git clone https://github.com/php-zookeeper/php-zookeeper.git \
@@ -169,13 +182,14 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
169182
&& rm -rf /tmp/libsodium \
170183
&& pecl install -o -f libsodium
171184
RUN cd /tmp \
172-
&& curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \
173-
&& tar zxvf ioncube_loaders_lin_x86-64.tar.gz \
185+
&& if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \
186+
&& curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \
187+
&& tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \
174188
&& export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \
175189
&& export PHP_EXT_DIR=$(php-config --extension-dir) \
176190
&& cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \
177191
&& rm -rf ./ioncube \
178-
&& rm ioncube_loaders_lin_x86-64.tar.gz
192+
&& rm ioncube_loaders_lin_${ioncube_arch}.tar.gz
179193

180194
ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini
181195
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
@@ -210,7 +224,7 @@ RUN mkdir -p ${MAGENTO_ROOT}
210224
VOLUME ${MAGENTO_ROOT}
211225

212226
RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME}
213-
RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi
227+
RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi
214228

215229
ENTRYPOINT ["/docker-entrypoint.sh"]
216230

0 commit comments

Comments
 (0)