Skip to content

Commit

Permalink
chialab#73 feat: install both Composer 1 and 2
Browse files Browse the repository at this point in the history
  • Loading branch information
fquffio committed Nov 1, 2020
1 parent 2772d13 commit 0f48458
Show file tree
Hide file tree
Showing 25 changed files with 475 additions and 200 deletions.
27 changes: 19 additions & 8 deletions 5.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,22 @@ RUN buildDeps=" \
&& rm -r /var/lib/apt/lists/*

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 5.4/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ RUN buildDeps=" \
&& a2enmod rewrite

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 5.4/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,22 @@ RUN buildDeps=" \
&& rm -r /var/lib/apt/lists/*

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 5.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,22 @@ RUN buildDeps=" \
&& rm -r /var/lib/apt/lists/*

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 5.5/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ RUN buildDeps=" \
&& a2enmod rewrite

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 5.5/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,22 @@ RUN buildDeps=" \
&& rm -r /var/lib/apt/lists/*

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 5.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \
# mbstring \

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 5.6/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,22 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \
&& a2enmod rewrite

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 5.6/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \
# mbstring \

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
27 changes: 19 additions & 8 deletions 7.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,22 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \
# mbstring \

# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& ln -s $(composer config --global home) /root/composer
ENV PATH=$PATH:/root/composer/vendor/bin COMPOSER_ALLOW_SUPERUSER=1

# Install prestissimo (composer plugin). Plugin that downloads packages in parallel to speed up the installation process
# After release of Composer 2.x, remove prestissimo, because parallelism already merged into Composer 2.x branch:
# https://github.com/composer/composer/pull/7904
RUN composer global require hirak/prestissimo
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum
Loading

0 comments on commit 0f48458

Please sign in to comment.