diff --git a/bin/init-docker.sh b/bin/init-docker.sh index ff79ffc5..56dce851 100755 --- a/bin/init-docker.sh +++ b/bin/init-docker.sh @@ -38,13 +38,20 @@ parse_bool_flag() esac } -version_is_valid() +php_version_is_valid() { if [[ ! $OPTARG =~ ^[0-9]+\.[0-9]+$ ]]; then die "Invalid version number $OPTARG for $OPT" fi } +image_version_is_valid() +{ + if [[ ! $OPTARG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + die "Invalid version number $OPTARG for $OPT" + fi +} + domain_is_valid() { # Check that a flag isn't being interpreted as the domain @@ -70,7 +77,7 @@ add_host() } PHP_VERSION="7.4" -IMAGE_VERSION="1.2.1" +IMAGE_VERSION="1.3.2" ADD_HOST=true DOMAIN="magento2.docker" USAGE="Init Docker @@ -100,13 +107,13 @@ while getopts "hp:i:-:" OPT; do case "$OPT" in p | php ) needs_arg "$@" - version_is_valid + php_version_is_valid PHP_VERSION="$OPTARG" ;; i | image ) needs_arg "$@" - version_is_valid + image_version_is_valid IMAGE_VERSION="$OPTARG" ;; diff --git a/composer.json b/composer.json index c83d64a0..88d08e6d 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.3.2", + "version": "1.3.3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/images/mailhog/1.0/Dockerfile b/images/mailhog/1.0/Dockerfile new file mode 100644 index 00000000..f7d70d66 --- /dev/null +++ b/images/mailhog/1.0/Dockerfile @@ -0,0 +1,29 @@ +# +# MailHog Dockerfile +# + +FROM golang:1.17.9-alpine + +# Install MailHog: +RUN apk --no-cache add --virtual build-dependencies \ + git \ + && mkdir -p /root/gocode \ + && export GOPATH=/root/gocode \ + && go get github.com/mailhog/MailHog@v1.0.1 \ + && mv /root/gocode/bin/MailHog /usr/local/bin \ + && rm -rf /root/gocode \ + && apk del --purge build-dependencies + +# Add mailhog user/group with uid/gid 1000. +# This is a workaround for boot2docker issue #581, see +# https://github.com/boot2docker/boot2docker/issues/581 +RUN adduser -D -u 1000 mailhog + +USER mailhog + +WORKDIR /home/mailhog + +ENTRYPOINT ["MailHog"] + +# Expose the SMTP and HTTP ports: +EXPOSE 1025 8025 diff --git a/images/php/7.2-cli/Dockerfile b/images/php/7.2-cli/Dockerfile index b36cb7dc..328508ca 100644 --- a/images/php/7.2-cli/Dockerfile +++ b/images/php/7.2-cli/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:7.2-cli ARG COMPOSER_VERSION=1.10.22 @@ -41,6 +52,10 @@ RUN apt-get update \ unzip \ vim \ openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -75,17 +90,14 @@ RUN pip3 install --upgrade setuptools \ RUN npm install -g grunt-cli # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ RUN docker-php-ext-configure \ imap --with-kerberos --with-imap-ssl -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache RUN docker-php-ext-configure \ @@ -102,7 +114,6 @@ RUN docker-php-ext-install -j$(nproc) \ gmp \ imap \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -136,12 +147,14 @@ RUN pecl install -o -f \ xdebug-3.1.2 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && 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 \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium RUN cd /tmp \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ - && tar zxvf ioncube_loaders_lin_x86-64.tar.gz \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ && export PHP_EXT_DIR=$(php-config --extension-dir) \ && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_x86-64.tar.gz + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini @@ -213,7 +227,7 @@ RUN mkdir -p ${MAGENTO_ROOT} VOLUME ${MAGENTO_ROOT} RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/images/php/7.2-fpm/Dockerfile b/images/php/7.2-fpm/Dockerfile index d37fb801..3afd18e6 100644 --- a/images/php/7.2-fpm/Dockerfile +++ b/images/php/7.2-fpm/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:7.2-fpm ARG MAGENTO_ROOT=/app @@ -23,6 +34,10 @@ RUN apt-get update \ sudo \ iproute2 \ git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -50,17 +65,14 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ RUN docker-php-ext-configure \ imap --with-kerberos --with-imap-ssl -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache RUN docker-php-ext-configure \ @@ -77,7 +89,6 @@ RUN docker-php-ext-install -j$(nproc) \ gmp \ imap \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -111,12 +122,14 @@ RUN pecl install -o -f \ xdebug-3.1.2 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && 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 \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium RUN cd /tmp \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ - && tar zxvf ioncube_loaders_lin_x86-64.tar.gz \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ && export PHP_EXT_DIR=$(php-config --extension-dir) \ && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_x86-64.tar.gz + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini diff --git a/images/php/7.3-cli/Dockerfile b/images/php/7.3-cli/Dockerfile index 47d7e589..065b9b45 100644 --- a/images/php/7.3-cli/Dockerfile +++ b/images/php/7.3-cli/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:7.3-cli ARG COMPOSER_VERSION=1.10.22 @@ -41,6 +52,10 @@ RUN apt-get update \ unzip \ vim \ openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -73,17 +88,14 @@ RUN pip3 install --upgrade setuptools \ RUN npm install -g grunt-cli # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ RUN docker-php-ext-configure \ imap --with-kerberos --with-imap-ssl -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache RUN docker-php-ext-configure \ @@ -100,7 +112,6 @@ RUN docker-php-ext-install -j$(nproc) \ gmp \ imap \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -133,12 +144,14 @@ RUN pecl install -o -f \ xdebug-3.1.2 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && 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 \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium RUN cd /tmp \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ - && tar zxvf ioncube_loaders_lin_x86-64.tar.gz \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ && export PHP_EXT_DIR=$(php-config --extension-dir) \ && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_x86-64.tar.gz + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini @@ -210,7 +224,7 @@ RUN mkdir -p ${MAGENTO_ROOT} VOLUME ${MAGENTO_ROOT} RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/images/php/7.3-fpm/Dockerfile b/images/php/7.3-fpm/Dockerfile index d6a3389b..39e6c977 100644 --- a/images/php/7.3-fpm/Dockerfile +++ b/images/php/7.3-fpm/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:7.3-fpm ARG MAGENTO_ROOT=/app @@ -23,6 +34,10 @@ RUN apt-get update \ sudo \ iproute2 \ git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -48,17 +63,14 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ RUN docker-php-ext-configure \ imap --with-kerberos --with-imap-ssl -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache RUN docker-php-ext-configure \ @@ -75,7 +87,6 @@ RUN docker-php-ext-install -j$(nproc) \ gmp \ imap \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -108,12 +119,14 @@ RUN pecl install -o -f \ xdebug-3.1.2 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && git clone https://github.com/php-zookeeper/php-zookeeper.git \ @@ -144,13 +157,14 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium RUN cd /tmp \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ - && tar zxvf ioncube_loaders_lin_x86-64.tar.gz \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ && export PHP_EXT_DIR=$(php-config --extension-dir) \ && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_x86-64.tar.gz + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini diff --git a/images/php/7.4-cli/Dockerfile b/images/php/7.4-cli/Dockerfile index f70a3f74..108426f4 100644 --- a/images/php/7.4-cli/Dockerfile +++ b/images/php/7.4-cli/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:7.4-cli ARG COMPOSER_VERSION=1.10.22 @@ -41,6 +52,10 @@ RUN apt-get update \ unzip \ vim \ openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -69,15 +84,12 @@ RUN pip3 install --upgrade setuptools \ RUN npm install -g grunt-cli # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache @@ -91,7 +103,6 @@ RUN docker-php-ext-install -j$(nproc) \ gettext \ gmp \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -123,12 +134,14 @@ RUN pecl install -o -f \ xdebug-3.1.2 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && git clone https://github.com/php-zookeeper/php-zookeeper.git \ @@ -159,13 +172,14 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium RUN cd /tmp \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ - && tar zxvf ioncube_loaders_lin_x86-64.tar.gz \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ && export PHP_EXT_DIR=$(php-config --extension-dir) \ && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_x86-64.tar.gz + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini @@ -200,7 +214,7 @@ RUN mkdir -p ${MAGENTO_ROOT} VOLUME ${MAGENTO_ROOT} RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/images/php/7.4-fpm/Dockerfile b/images/php/7.4-fpm/Dockerfile index 23cc3313..2c085a62 100644 --- a/images/php/7.4-fpm/Dockerfile +++ b/images/php/7.4-fpm/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:7.4-fpm ARG MAGENTO_ROOT=/app @@ -23,6 +34,10 @@ RUN apt-get update \ sudo \ iproute2 \ git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -44,15 +59,12 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache @@ -66,7 +78,6 @@ RUN docker-php-ext-install -j$(nproc) \ gettext \ gmp \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -98,12 +109,14 @@ RUN pecl install -o -f \ xdebug-3.1.2 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && git clone https://github.com/php-zookeeper/php-zookeeper.git \ @@ -134,13 +147,14 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium RUN cd /tmp \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ - && tar zxvf ioncube_loaders_lin_x86-64.tar.gz \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ && export PHP_EXT_DIR=$(php-config --extension-dir) \ && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_x86-64.tar.gz + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index 54c0367b..e00a862f 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:8.0.14-cli ARG COMPOSER_VERSION=2.1.14 @@ -41,6 +52,10 @@ RUN apt-get update \ unzip \ vim \ openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -66,15 +81,12 @@ RUN pip3 install --upgrade setuptools \ RUN npm install -g grunt-cli # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache @@ -88,7 +100,6 @@ RUN docker-php-ext-install -j$(nproc) \ gettext \ gmp \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -116,12 +127,14 @@ RUN pecl install -o -f \ xmlrpc-1.0.0RC3 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && git clone https://github.com/php-zookeeper/php-zookeeper.git \ @@ -185,7 +198,7 @@ RUN mkdir -p ${MAGENTO_ROOT} VOLUME ${MAGENTO_ROOT} RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/images/php/8.0-fpm/Dockerfile b/images/php/8.0-fpm/Dockerfile index 12d2b7a5..c97994d6 100644 --- a/images/php/8.0-fpm/Dockerfile +++ b/images/php/8.0-fpm/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:8.0.14-fpm ARG MAGENTO_ROOT=/app @@ -23,6 +34,10 @@ RUN apt-get update \ sudo \ iproute2 \ git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -41,15 +56,12 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache @@ -63,7 +75,6 @@ RUN docker-php-ext-install -j$(nproc) \ gettext \ gmp \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -91,12 +102,14 @@ RUN pecl install -o -f \ xmlrpc-1.0.0RC3 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && git clone https://github.com/php-zookeeper/php-zookeeper.git \ diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 05a43dcc..9708007e 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:8.1.1-cli ARG COMPOSER_VERSION=2.1.14 @@ -41,6 +52,10 @@ RUN apt-get update \ unzip \ vim \ openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -66,15 +81,12 @@ RUN pip3 install --upgrade setuptools \ RUN npm install -g grunt-cli # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache @@ -88,7 +100,6 @@ RUN docker-php-ext-install -j$(nproc) \ gettext \ gmp \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -116,12 +127,14 @@ RUN pecl install -o -f \ xmlrpc-1.0.0RC3 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && git clone https://github.com/php-zookeeper/php-zookeeper.git \ @@ -185,7 +198,7 @@ RUN mkdir -p ${MAGENTO_ROOT} VOLUME ${MAGENTO_ROOT} RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/images/php/8.1-fpm/Dockerfile b/images/php/8.1-fpm/Dockerfile index 52926182..bb188c99 100644 --- a/images/php/8.1-fpm/Dockerfile +++ b/images/php/8.1-fpm/Dockerfile @@ -1,4 +1,15 @@ # This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:8.1.1-fpm ARG MAGENTO_ROOT=/app @@ -23,6 +34,10 @@ RUN apt-get update \ sudo \ iproute2 \ git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ libbz2-dev \ libjpeg62-turbo-dev \ libpng-dev \ @@ -41,15 +56,12 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library RUN docker-php-ext-configure \ gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - ldap --with-libdir=lib/x86_64-linux-gnu RUN docker-php-ext-configure \ opcache --enable-opcache @@ -63,7 +75,6 @@ RUN docker-php-ext-install -j$(nproc) \ gettext \ gmp \ intl \ - ldap \ mysqli \ opcache \ pdo_mysql \ @@ -91,12 +102,14 @@ RUN pecl install -o -f \ xmlrpc-1.0.0RC3 \ yaml -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;") \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} RUN mkdir -p /tmp/zoo \ && cd /tmp/zoo \ && git clone https://github.com/php-zookeeper/php-zookeeper.git \ diff --git a/images/php/cli/Dockerfile b/images/php/cli/Dockerfile index b63855ed..b793da07 100755 --- a/images/php/cli/Dockerfile +++ b/images/php/cli/Dockerfile @@ -1,4 +1,15 @@ {%note%} +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:{%version%}-cli ARG COMPOSER_VERSION={%composer_version%} @@ -37,9 +48,8 @@ RUN pip3 install --upgrade setuptools \ RUN npm install -g grunt-cli # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library {%docker-php-ext-configure%} @@ -84,7 +94,7 @@ RUN ["chmod", "+x", \ {%volumes_def%} RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/images/php/fpm/Dockerfile b/images/php/fpm/Dockerfile index d070b3f0..5da5ca40 100755 --- a/images/php/fpm/Dockerfile +++ b/images/php/fpm/Dockerfile @@ -1,4 +1,15 @@ {%note%} +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + FROM php:{%version%}-fpm ARG MAGENTO_ROOT=/app @@ -21,9 +32,8 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # Install MailHog -RUN curl -L -O https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ - && sudo chmod +x mhsendmail_linux_amd64 \ - && sudo mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail # Configure the gd library {%docker-php-ext-configure%} diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 8d09fdd5..d6dd63c0 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -272,9 +272,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string $phpExtType )); } - if (isset($phpExtInstallConfig[ExtensionResolver::EXTENSION_OS_DEPENDENCIES]) - && $phpExtType !== ExtensionResolver::EXTENSION_TYPE_INSTALLATION_SCRIPT - ) { + if (isset($phpExtInstallConfig[ExtensionResolver::EXTENSION_OS_DEPENDENCIES])) { $packages = array_merge( $packages, $phpExtInstallConfig[ExtensionResolver::EXTENSION_OS_DEPENDENCIES] diff --git a/src/Compose/DeveloperBuilder.php b/src/Compose/DeveloperBuilder.php index 84db48e6..8e2f9874 100644 --- a/src/Compose/DeveloperBuilder.php +++ b/src/Compose/DeveloperBuilder.php @@ -12,6 +12,7 @@ use Magento\CloudDocker\Config\Config; use Magento\CloudDocker\Config\Environment\Converter; use Magento\CloudDocker\Filesystem\FileList; +use Magento\CloudDocker\Service\ServiceInterface; /** * Developer compose configuration. @@ -149,11 +150,18 @@ public function build(Config $config): Manager $dbVolumes ) ]); + + $variables = [ + 'MAGENTO_RUN_MODE' => 'developer', + 'PHP_EXTENSIONS' => implode(' ', $this->extensionResolver->get($config)) + ]; + + if ($config->hasServiceEnabled(ServiceInterface::SERVICE_MAILHOG)) { + $variables['SENDMAIL_PATH'] = '/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025'; + } + $manager->updateService(self::SERVICE_GENERIC, [ - 'environment' => $this->converter->convert(array_merge( - ['MAGENTO_RUN_MODE' => 'developer'], - ['PHP_EXTENSIONS' => implode(' ', $this->extensionResolver->get($config))] - )) + 'environment' => $this->converter->convert($variables) ]); return $manager; diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 7efedb2a..d5ddef93 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -169,17 +169,23 @@ public static function getConfig(): array 'blackfire' => [ '>=7.2' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, + self::EXTENSION_OS_DEPENDENCIES => [ + 'gnupg2', + 'ca-certificates', + 'lsb-release', + 'software-properties-common' + ], // phpcs:disable self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH -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;") -mkdir -p /tmp/blackfire -tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire -mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so -echo blackfire.agent_socket=tcp://blackfire:8707 > $(php -i | grep "additional .ini" | awk '{print $9}')/blackfire.ini -rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz +curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg +install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ +echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list +apt-get update +apt-get install blackfire-php +rm -rf /var/lib/apt/lists/* BASH // phpcs:enable - ] + ], ], 'bz2' => [ '>=7.0' => [ @@ -257,9 +263,12 @@ public static function getConfig(): array ], 'ldap' => [ '>=7.0' => [ - self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE, + self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, self::EXTENSION_OS_DEPENDENCIES => ['libldap2-dev'], - self::EXTENSION_CONFIGURE_OPTIONS => ['--with-libdir=lib/x86_64-linux-gnu'], + self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH +if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi +docker-php-ext-configure ldap --with-libdir=lib/\${ldap_arch} +BASH ], ], 'mailparse' => [ @@ -458,13 +467,14 @@ public static function getConfig(): array self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH cd /tmp -curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -tar zxvf ioncube_loaders_lin_x86-64.tar.gz +if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi +curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_\${ioncube_arch}.tar.gz +tar zxvf ioncube_loaders_lin_\${ioncube_arch}.tar.gz export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") export PHP_EXT_DIR=$(php-config --extension-dir) cp "./ioncube/ioncube_loader_lin_\${PHP_VERSION}.so" "\${PHP_EXT_DIR}/ioncube.so" rm -rf ./ioncube -rm ioncube_loaders_lin_x86-64.tar.gz +rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz BASH ], ], diff --git a/src/Service/ServiceFactory.php b/src/Service/ServiceFactory.php index 99f3dc5b..b04286fb 100644 --- a/src/Service/ServiceFactory.php +++ b/src/Service/ServiceFactory.php @@ -81,7 +81,7 @@ class ServiceFactory ServiceInterface::SERVICE_NGINX => self::SERVICE_NGINX_CONFIG, ServiceInterface::SERVICE_VARNISH => [ 'image' => 'magento/magento-cloud-docker-varnish', - 'version' => '6.2', + 'version' => '6.6', 'pattern' => self::PATTERN_VERSIONED, ], ServiceInterface::SERVICE_TLS => self::SERVICE_NGINX_CONFIG, @@ -163,9 +163,9 @@ class ServiceFactory 'pattern' => self::PATTERN_STD ], ServiceInterface::SERVICE_MAILHOG => [ - 'image' => 'mailhog/mailhog', - 'version' => 'latest', - 'pattern' => self::PATTERN_STD, + 'image' => 'magento/magento-cloud-docker-mailhog', + 'version' => '1.0', + 'pattern' => self::PATTERN_VERSIONED, ] ]; diff --git a/src/Test/Functional/Acceptance/Services72Cest.php b/src/Test/Functional/Acceptance/Services72Cest.php index f6c54b7c..b627e4bd 100644 --- a/src/Test/Functional/Acceptance/Services72Cest.php +++ b/src/Test/Functional/Acceptance/Services72Cest.php @@ -27,7 +27,7 @@ protected function servicesDataProvider(): array 'options' => '', 'expectedResult' => [ 'redis:5.0', - 'magento/magento-cloud-docker-varnish:6.2-1.3', + 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.19-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', @@ -39,7 +39,7 @@ protected function servicesDataProvider(): array 'options' => '--redis=3.2 --db=10.1 --php=7.4 --rmq=3.5', 'expectedResult' => [ 'redis:3.2', - 'magento/magento-cloud-docker-varnish:6.2-1.3', + 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.19-1.3', 'magento/magento-cloud-docker-php:7.4-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', @@ -52,7 +52,7 @@ protected function servicesDataProvider(): array 'options' => '--redis=4.0 --db=10.2 --php=7.2 --rmq=3.6', 'expectedResult' => [ 'redis:4.0', - 'magento/magento-cloud-docker-varnish:6.2-1.3', + 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.19-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', @@ -65,7 +65,7 @@ protected function servicesDataProvider(): array 'options' => '--with-cron --with-selenium', 'expectedResult' => [ 'redis:5.0', - 'magento/magento-cloud-docker-varnish:6.2-1.3', + 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.19-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', diff --git a/src/Test/Functional/Acceptance/ServicesCest.php b/src/Test/Functional/Acceptance/ServicesCest.php index cc777745..52916362 100644 --- a/src/Test/Functional/Acceptance/ServicesCest.php +++ b/src/Test/Functional/Acceptance/ServicesCest.php @@ -91,7 +91,7 @@ protected function servicesDataProvider(): array 'options' => '', 'expectedResult' => [ 'redis:5.0', - 'magento/magento-cloud-docker-varnish:6.2-1.3', + 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.19-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', @@ -103,7 +103,7 @@ protected function servicesDataProvider(): array 'options' => '--redis=3.2 --db=10.1 --php=7.2 --rmq=3.5', 'expectedResult' => [ 'redis:3.2', - 'magento/magento-cloud-docker-varnish:6.2-1.3', + 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.19-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', @@ -116,7 +116,7 @@ protected function servicesDataProvider(): array 'options' => '--redis=4.0 --db=10.2 --php=7.4 --rmq=3.6', 'expectedResult' => [ 'redis:4.0', - 'magento/magento-cloud-docker-varnish:6.2-1.3', + 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.19-1.3', 'magento/magento-cloud-docker-php:7.4-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', @@ -129,7 +129,7 @@ protected function servicesDataProvider(): array 'options' => '--with-cron --with-selenium', 'expectedResult' => [ 'redis:5.0', - 'magento/magento-cloud-docker-varnish:6.2-1.3', + 'magento/magento-cloud-docker-varnish:6.6-1.3', 'magento/magento-cloud-docker-nginx:1.19-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', diff --git a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml index 437f091b..e054a41c 100644 --- a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml @@ -127,7 +127,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -211,7 +211,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml index 9265d881..4282169c 100644 --- a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml @@ -113,7 +113,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -147,6 +147,7 @@ services: environment: - MAGENTO_RUN_MODE=developer - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' + - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' @@ -187,7 +188,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml index e0dc3ac9..d8c7d928 100644 --- a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml @@ -93,7 +93,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -127,6 +127,7 @@ services: environment: - MAGENTO_RUN_MODE=developer - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' + - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' build: hostname: build.magento2.docker image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' @@ -163,7 +164,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml index 27d95b9b..6e8bab5e 100644 --- a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml @@ -97,7 +97,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: diff --git a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml index 99907372..0585618f 100644 --- a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml @@ -97,7 +97,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml index b3990134..53d8630b 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml @@ -106,7 +106,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -186,7 +186,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml index 91185266..428d8228 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml @@ -106,7 +106,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -186,7 +186,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml index ed078cb5..a38f457a 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml @@ -106,7 +106,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -186,7 +186,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml index afea27bd..e29152a7 100644 --- a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml @@ -107,7 +107,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' ports: - '80:80' networks: @@ -170,7 +170,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml index 71351546..fe34a339 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml @@ -160,7 +160,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml index 1e767642..519258d7 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml @@ -177,7 +177,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml index a7eaef6c..2b9e82d2 100644 --- a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml @@ -70,7 +70,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.test - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -142,7 +142,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.test - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1026:1025' - '8026:8025' diff --git a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml index a7eaef6c..2b9e82d2 100644 --- a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml @@ -70,7 +70,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.test - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -142,7 +142,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.test - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1026:1025' - '8026:8025' diff --git a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml index 1cb3ed70..5bd8a9e7 100644 --- a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml @@ -216,7 +216,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.test - image: 'mailhog/mailhog:latest' + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1026:1025' - '8026:8025' diff --git a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml index 20315574..f2b4ae19 100644 --- a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml @@ -61,7 +61,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: 'magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' ports: - '80:80' networks: diff --git a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml index 76dade5f..74f1e281 100644 --- a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml @@ -109,7 +109,7 @@ services: condition: service_started varnish: hostname: varnish.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-varnish:6.2-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-varnish:6.6-1.2.0' networks: magento: aliases: @@ -189,7 +189,7 @@ services: condition: service_healthy mailhog: hostname: mailhog.magento2.docker - image: '123.example.com/mailhog/mailhog:latest' + image: '123.example.com/magento/magento-cloud-docker-mailhog:1.0-1.2.0' ports: - '1025:1025' - '8025:8025' diff --git a/tests/functional/Codeception/TestInfrastructure.php b/tests/functional/Codeception/TestInfrastructure.php index 70ad4e1e..3c5af89a 100644 --- a/tests/functional/Codeception/TestInfrastructure.php +++ b/tests/functional/Codeception/TestInfrastructure.php @@ -420,6 +420,13 @@ public function addEceToolsGitRepoToComposer(): bool */ private function addGitRepoToComposer(string $name): bool { + $repoUrl = $this->_getConfig($name . '_repo'); + + // Do not add repo if url is empty + if (empty($repoUrl)) { + return true; + } + return $this->taskComposerConfig() ->set('repositories.' . $name, json_encode( [