diff --git a/magento/Dockerfile-2.3 b/magento/Dockerfile-2.3 index cc3d2ff..2d18892 100644 --- a/magento/Dockerfile-2.3 +++ b/magento/Dockerfile-2.3 @@ -8,10 +8,11 @@ ARG SAMPLE_DATA=false ENV CI=true ENV URL=http://localhost/ ENV FLAT_TABLES=false -ENV COMPOSER_VERSION=1 COPY scripts/retry retry COPY scripts/install-phpstan.php scripts/install-phpstan.php +COPY scripts/upgrade-to-composer-2.php scripts/upgrade-to-composer-2.php +COPY scripts/allow-composer-plugins.php scripts/allow-composer-plugins.php COPY patches/vertex-compilation-issue.patch vertex-compilation-issue.patch COPY patches/APSB22-12/MDVA-43395_EE_2.4.3-p1_COMPOSER_v1.patch MDVA-43395_EE_2.4.3-p1_COMPOSER_v1.patch COPY patches/APSB22-12/MDVA-43443_EE_2.3.4_COMPOSER_v1.patch MDVA-43443_EE_2.3.4_COMPOSER_v1.patch @@ -19,9 +20,16 @@ COPY patches/APSB22-12/MDVA-43443_EE_2.4.2-p2_COMPOSER_v1.patch MDVA-43443_EE_2. COPY templates/memory-limit-php.ini /usr/local/etc/php/conf.d/memory-limit-php.ini RUN ./start-services && \ + composer self-update --2 && \ + echo "Composer version:" && \ + composer --version && \ curl -o magento.zip https://repo-magento-mirror.fooman.co.nz/dist/magento/$MAGENTO_TYPE/magento-$MAGENTO_TYPE-$MAGENTO_VERSION.zip && \ unzip -q magento.zip -d . && \ rm magento.zip && \ + php scripts/allow-composer-plugins.php && \ + rm scripts/allow-composer-plugins.php && \ + php scripts/upgrade-to-composer-2.php && \ + rm scripts/upgrade-to-composer-2.php && \ composer config --unset repositories.0 && \ composer config repositories.fooman composer https://repo-magento-mirror.fooman.co.nz/ && \ ./retry "composer install" && \ diff --git a/magento/Dockerfile-2.4 b/magento/Dockerfile-2.4 index 3e73ad0..28a1f30 100644 --- a/magento/Dockerfile-2.4 +++ b/magento/Dockerfile-2.4 @@ -14,19 +14,23 @@ COPY scripts/retry retry COPY patches/ patches/ COPY scripts/apply-2.4-patches.php scripts/apply-2.4-patches.php COPY scripts/downgrade-monolog.php scripts/downgrade-monolog.php +COPY scripts/upgrade-to-composer-2.php scripts/upgrade-to-composer-2.php COPY scripts/allow-composer-plugins.php scripts/allow-composer-plugins.php COPY scripts/remove-paypal-braintree.php scripts/remove-paypal-braintree.php COPY scripts/patch-AC2855.php scripts/patch-AC2855.php COPY templates/memory-limit-php.ini /usr/local/etc/php/conf.d/memory-limit-php.ini RUN ./start-services && \ - if (( $(php -r 'echo version_compare(getenv("MAGENTO_VERSION"), "2.4.2", "<=") ? "true" : "false";') = "true" )); then composer self-update --1; else composer self-update --2; fi && \ + composer self-update --2 && \ echo "Composer version:" && \ composer --version && \ curl -o magento.zip https://repo-magento-mirror.fooman.co.nz/dist/magento/$MAGENTO_TYPE/magento-$MAGENTO_TYPE-$MAGENTO_VERSION.zip && \ unzip -q magento.zip -d . && \ rm magento.zip && \ - if (( $(php -r 'echo version_compare(getenv("MAGENTO_VERSION"), "2.4.2", "<=") ? "true" : "false";') = "true" )); then echo "Using Composer version 1 so skipping allow-plugins"; else php scripts/allow-composer-plugins.php rm scripts/allow-composer-plugins.php; fi && \ + php scripts/allow-composer-plugins.php && \ + rm scripts/allow-composer-plugins.php && \ + php scripts/upgrade-to-composer-2.php && \ + rm scripts/upgrade-to-composer-2.php && \ composer config --unset repositories.0 && \ composer config repositories.fooman composer https://repo-magento-mirror.fooman.co.nz/ && \ if [ "$MAGENTO_VERSION" = "2.4.4" ]; then composer require "magento/security-package:1.1.3-p1 as 1.1.3" --no-update; fi && \ diff --git a/magento/scripts/upgrade-to-composer-2.php b/magento/scripts/upgrade-to-composer-2.php new file mode 100644 index 0000000..96a681d --- /dev/null +++ b/magento/scripts/upgrade-to-composer-2.php @@ -0,0 +1,51 @@ +