Skip to content

Commit

Permalink
Add composer
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehaertl committed Mar 9, 2017
1 parent 71e43cc commit 5af9e95
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 5.6/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ RUN apt-get update \
# Cleanup to keep the images size small
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*

# Install composer
COPY install-composer /install-composer
RUN /install-composer && rm /install-composer
17 changes: 17 additions & 0 deletions 5.6/apache/install-composer
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --install-dir=/usr/bin --filename=composer
RESULT=$?
rm composer-setup.php
exit $RESULT
4 changes: 4 additions & 0 deletions 5.6/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ RUN apt-get update \
# Cleanup to keep the images size small
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*

# Install composer
COPY install-composer /install-composer
RUN /install-composer && rm /install-composer
17 changes: 17 additions & 0 deletions 5.6/fpm/install-composer
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --install-dir=/usr/bin --filename=composer
RESULT=$?
rm composer-setup.php
exit $RESULT
4 changes: 4 additions & 0 deletions 7.0/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ RUN apt-get update \
# Cleanup to keep the images size small
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*

# Install composer
COPY install-composer /install-composer
RUN /install-composer && rm /install-composer
17 changes: 17 additions & 0 deletions 7.0/apache/install-composer
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --install-dir=/usr/bin --filename=composer
RESULT=$?
rm composer-setup.php
exit $RESULT
4 changes: 4 additions & 0 deletions 7.0/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ RUN apt-get update \
# Cleanup to keep the images size small
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*

# Install composer
COPY install-composer /install-composer
RUN /install-composer && rm /install-composer
17 changes: 17 additions & 0 deletions 7.0/fpm/install-composer
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --install-dir=/usr/bin --filename=composer
RESULT=$?
rm composer-setup.php
exit $RESULT
4 changes: 4 additions & 0 deletions 7.1/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ RUN apt-get update \
# Cleanup to keep the images size small
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*

# Install composer
COPY install-composer /install-composer
RUN /install-composer && rm /install-composer
17 changes: 17 additions & 0 deletions 7.1/apache/install-composer
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --install-dir=/usr/bin --filename=composer
RESULT=$?
rm composer-setup.php
exit $RESULT
4 changes: 4 additions & 0 deletions 7.1/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ RUN apt-get update \
# Cleanup to keep the images size small
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*

# Install composer
COPY install-composer /install-composer
RUN /install-composer && rm /install-composer
17 changes: 17 additions & 0 deletions 7.1/fpm/install-composer
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --install-dir=/usr/bin --filename=composer
RESULT=$?
rm composer-setup.php
exit $RESULT

0 comments on commit 5af9e95

Please sign in to comment.