Skip to content

Commit

Permalink
Upgrade to PHP 8.0 and Composer 2
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesChou committed Jan 22, 2021
1 parent f2cc9e4 commit a0a20ad
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 68 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
uses: elgohr/Publish-Docker-Github-Action@2.22
with:
name: mileschou/composer
tags: "latest,7.4"
tags: "latest,8.0"
username: ${{ secrets.GITHUB_USERNAME }}
password: ${{ secrets.GHCR_PAT }}
registry: ghcr.io
dockerfile: 7.4/Dockerfile
dockerfile: 8.0/Dockerfile
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["7.3", "7.2", "7.1", "7.0", "5.6", "5.5"]
version: ["7.4", "7.3", "7.2", "7.1", "7.0", "5.6", "5.5"]
steps:
- uses: actions/checkout@master
- name: Build PHP ${{ matrix.version }} and publish to GitHub Registry
Expand Down
11 changes: 4 additions & 7 deletions 5.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
CMD ["--info"]
11 changes: 4 additions & 7 deletions 5.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
CMD ["--info"]
11 changes: 4 additions & 7 deletions 7.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
CMD ["--info"]
11 changes: 4 additions & 7 deletions 7.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
CMD ["--info"]
11 changes: 4 additions & 7 deletions 7.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
CMD ["--info"]
11 changes: 4 additions & 7 deletions 7.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
CMD ["--info"]
11 changes: 4 additions & 7 deletions 7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
CMD ["--info"]
33 changes: 33 additions & 0 deletions 8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM php:8.0-alpine

LABEL org.opencontainers.image.source="https://github.com/MilesChou/composer-action" \
repository="https://github.com/MilesChou/composer-action" \
maintainer="MilesChou <jangconan@gmail.com>"

RUN set -xe && \
apk add --no-cache \
git \
unzip

ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
5 changes: 5 additions & 0 deletions 8.0/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

exec composer "$@"
8 changes: 8 additions & 0 deletions 8.0/install/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM ghcr.io/mileschou/composer:8.0

CMD ["install"]
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM php:7.4-alpine
FROM php:8.0-alpine

LABEL org.opencontainers.image.source="https://github.com/MilesChou/composer-action" \
repository="https://github.com/MilesChou/composer-action" \
Expand All @@ -17,20 +17,17 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["--info"]
CMD ["--info"]
9 changes: 3 additions & 6 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ RUN set -xe && \
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer \
COMPOSER_VERSION=1.10.5
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1.10.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache
composer self-update --2

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

Expand Down
2 changes: 1 addition & 1 deletion install/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM mileschou/composer:7.4
FROM mileschou/composer:8.0

CMD ["install"]
3 changes: 2 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generated_warning() {
EOH
}

LATEST_VERSION=7.4
LATEST_VERSION=8.0

VERSIONS="
5.5
Expand All @@ -20,6 +20,7 @@ VERSIONS="
7.2
7.3
7.4
8.0
"

for version in ${VERSIONS}; do
Expand Down

0 comments on commit a0a20ad

Please sign in to comment.