Repository navigation
Add PHP 8.3-8.5 and migrate CI to GitHub Actions #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
bee6677
Add PHP 8.3-8.5 images and migrate CI to GitHub Actions
rick-lam d95803c
ci: build single-arch in GH Actions so image loads into daemon
rick-lam efe15b4
ci: multi-arch publish per supported alpine base
rick-lam 3d77ef4
ci: fix build/test failures across the matrix
rick-lam 1b5005c
ci: drop unavailable 8.5 packages and fix 8.1/8.2 tag tests
rick-lam c5a47c6
ci: match memory_limit on whole word
rick-lam 885342c
Restore php85-zlib (provided as virtual by php85-common)
rick-lam 8bc882e
test: assert 8 / latest aliases on 8.5 tag test
rick-lam c3128bf
Install historical alpine key instead of --allow-untrusted for gnu-li…
rick-lam 7e5b758
Rebase 8.3-8.5 on docker-library php-cli-alpine images
rick-lam 50f675c
8.3: enable opcache shared module
rick-lam 6a0f376
Tighten bats container safe.directory, loosen iconv translit assertion
rick-lam ecf1249
Makefile: derive aggregate targets from a single VERSIONS list
rick-lam 6460767
Make versions.json the single source of truth for supported versions
rick-lam bf486e8
README: fix ev/event typo and outdated phpdbg example
rick-lam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| build: | ||
| name: PHP ${{ matrix.version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| version: | ||
| - "5.6" | ||
| - "7.0" | ||
| - "7.1" | ||
| - "7.2" | ||
| - "7.3" | ||
| - "7.4" | ||
| - "8.0" | ||
| - "8.1" | ||
| - "8.2" | ||
| - "8.3" | ||
| - "8.4" | ||
| - "8.5" | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v4 | ||
|
|
||
| - name: Build | ||
| run: make build-${{ matrix.version }} platform=--platform=linux/amd64 | ||
|
|
||
| - name: Tag | ||
| run: make tag-${{ matrix.version }} | ||
|
|
||
| - name: Test | ||
| run: make test-${{ matrix.version }} | ||
|
|
||
| - name: Login to Docker Hub | ||
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Deploy | ||
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | ||
| run: make deploy-${{ matrix.version }} | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.bats |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| FROM alpine:3.19 | ||
|
|
||
| LABEL maintainer="developers@graze.com" \ | ||
| license="MIT" \ | ||
| org.label-schema.schema-version="1.0" \ | ||
| org.label-schema.vendor="graze" \ | ||
| org.label-schema.name="php-alpine" \ | ||
| org.label-schema.description="small php image based on alpine" \ | ||
| org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" | ||
|
|
||
| # Fix for iconv: https://github.com/docker-library/php/issues/240 | ||
| RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted | ||
|
|
||
|
rick-lam marked this conversation as resolved.
Outdated
|
||
| RUN set -xe \ | ||
| && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.19/community" >> /etc/apk/repositories \ | ||
| && apk add --update --no-cache \ | ||
| ca-certificates \ | ||
| curl \ | ||
| gnu-libiconv \ | ||
| openssh-client \ | ||
| libmemcached-libs \ | ||
| libevent \ | ||
| libssl3 \ | ||
| musl \ | ||
| yaml \ | ||
| php83 \ | ||
| php83-pecl-apcu \ | ||
| php83-pecl-event \ | ||
| php83-pecl-memcached \ | ||
| php83-pecl-yaml \ | ||
| php83-bcmath \ | ||
| php83-common \ | ||
| php83-ctype \ | ||
| php83-curl \ | ||
| php83-dom \ | ||
| php83-fileinfo \ | ||
| php83-iconv \ | ||
| php83-intl \ | ||
| php83-openssl \ | ||
| php83-opcache \ | ||
| php83-mbstring \ | ||
| php83-mysqlnd \ | ||
| php83-mysqli \ | ||
| php83-pcntl \ | ||
| php83-pgsql \ | ||
| php83-pdo_mysql \ | ||
| php83-pdo_pgsql \ | ||
| php83-pdo_sqlite \ | ||
| php83-phar \ | ||
| php83-posix \ | ||
| php83-simplexml \ | ||
| php83-session \ | ||
| php83-soap \ | ||
| php83-sockets \ | ||
| php83-sodium \ | ||
| php83-tokenizer \ | ||
| php83-xml \ | ||
| php83-xmlreader \ | ||
| php83-xmlwriter \ | ||
| php83-zip \ | ||
| php83-zlib | ||
|
|
||
| ENV PHP_INI_DIR /etc/php83 | ||
|
|
||
| RUN ln -s /usr/bin/php83 /usr/bin/php | ||
| RUN ln -s /usr/bin/pecl83 /usr/bin/pecl | ||
|
|
||
| COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/ | ||
|
|
||
| WORKDIR /srv | ||
|
|
||
| ARG BUILD_DATE | ||
| ARG VCS_REF | ||
|
|
||
| LABEL org.label-schema.vcs-ref=$VCS_REF \ | ||
| org.label-schema.build-date=$BUILD_DATE | ||
|
|
||
| # Fix for iconv: https://github.com/docker-library/php/issues/240 | ||
| ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| FROM graze/php-alpine:8.3 | ||
|
|
||
| RUN apk add --update --no-cache \ | ||
| php83-phpdbg | ||
|
|
||
| ARG BUILD_DATE | ||
| ARG VCS_REF | ||
|
|
||
| LABEL org.label-schema.vcs-ref=$VCS_REF \ | ||
| org.label-schema.build-date=$BUILD_DATE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| #!/usr/bin/env bats | ||
|
|
||
| @test "php version is correct" { | ||
| run docker run --rm ${container} php -v | ||
| echo 'status:' $status | ||
| echo 'output:' $output | ||
| version="$(echo $output | sed 's/.*PHP \([0-9].[0-9]\).*/\1/')" | ||
| echo 'version:' $version | ||
| [ "$status" -eq 0 ] | ||
| [[ "$version" == "8.3" ]] | ||
| } | ||
|
|
||
| @test "the image has the correct php modules installed" { | ||
| run docker run --rm ${container} php -m | ||
| echo 'status:' $status | ||
| echo 'output:' $output | ||
| [ "$status" -eq 0 ] | ||
| [[ "${output}" == *"apcu"* ]] | ||
| [[ "${output}" == *"bcmath"* ]] | ||
| [[ "${output}" == *"Core"* ]] | ||
| [[ "${output}" == *"ctype"* ]] | ||
| [[ "${output}" == *"curl"* ]] | ||
| [[ "${output}" == *"date"* ]] | ||
| [[ "${output}" == *"dom"* ]] | ||
| [[ "${output}" == *"event"* ]] | ||
| [[ "${output}" == *"fileinfo"* ]] | ||
| [[ "${output}" == *"filter"* ]] | ||
| [[ "${output}" == *"hash"* ]] | ||
| [[ "${output}" == *"iconv"* ]] | ||
| [[ "${output}" == *"intl"* ]] | ||
| [[ "${output}" == *"json"* ]] | ||
| [[ "${output}" == *"libxml"* ]] | ||
| [[ "${output}" == *"mbstring"* ]] | ||
| [[ "${output}" == *"memcached"* ]] | ||
| [[ "${output}" == *"mysqli"* ]] | ||
| [[ "${output}" == *"mysqlnd"* ]] | ||
| [[ "${output}" == *"openssl"* ]] | ||
| [[ "${output}" == *"pcre"* ]] | ||
| [[ "${output}" == *"pcntl"* ]] | ||
| [[ "${output}" == *"PDO"* ]] | ||
| [[ "${output}" == *"pdo_mysql"* ]] | ||
| [[ "${output}" == *"pdo_pgsql"* ]] | ||
| [[ "${output}" == *"pdo_sqlite"* ]] | ||
| [[ "${output}" == *"pgsql"* ]] | ||
| [[ "${output}" == *"Phar"* ]] | ||
| [[ "${output}" == *"posix"* ]] | ||
| [[ "${output}" == *"readline"* ]] | ||
| [[ "${output}" == *"Reflection"* ]] | ||
| [[ "${output}" == *"session"* ]] | ||
| [[ "${output}" == *"SimpleXML"* ]] | ||
| [[ "${output}" == *"soap"* ]] | ||
| [[ "${output}" == *"sodium"* ]] | ||
| [[ "${output}" == *"sockets"* ]] | ||
| [[ "${output}" == *"SPL"* ]] | ||
| [[ "${output}" == *"standard"* ]] | ||
| [[ "${output}" == *"tokenizer"* ]] | ||
| [[ "${output}" == *"xml"* ]] | ||
| [[ "${output}" == *"xmlreader"* ]] | ||
| [[ "${output}" == *"xmlwriter"* ]] | ||
| [[ "${output}" == *"yaml"* ]] | ||
| [[ "${output}" == *"Zend OPcache"* ]] | ||
| [[ "${output}" == *"zip"* ]] | ||
| [[ "${output}" == *"zlib"* ]] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ; Maximum amount of memory a script may consume (128MB) | ||
| ; http://php.net/memory-limit | ||
| memory_limit = 1024M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ; This directive determines whether or not PHP will recognize code between | ||
| ; <? and ?> tags as PHP source which should be processed as such. It's been | ||
| ; recommended for several years that you not use the short tag "short cut" and | ||
| ; instead to use the full <?php and ?> tag combination. With the wide spread use | ||
| ; of XML and use of these tags by other languages, the server can become easily | ||
| ; confused and end up parsing the wrong code in the wrong context. But because | ||
| ; this short cut has been a feature for such a long time, it's currently still | ||
| ; supported for backwards compatibility, but we recommend you don't use them. | ||
| ; Default Value: On | ||
| ; Development Value: Off | ||
| ; Production Value: Off | ||
| ; http://php.net/short-open-tag | ||
| short_open_tag = On |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/env bats | ||
|
|
||
| @test "the image has phpdbg" { | ||
| run docker run ${container} which phpdbg83 | ||
| echo 'status:' $status | ||
| echo 'output:' $output | ||
| [ "$status" -eq 0 ] | ||
| [[ "${output}" == *"phpdbg83"* ]] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/usr/bin/env bats | ||
|
|
||
| @test "the main tags are created" { | ||
| run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.3 --format '{{.ID}}')"" | ||
| echo 'output:' $output | ||
| [[ "$output" == *"(8.3)"* ]] | ||
| } | ||
|
|
||
| @test "the test tags are created" { | ||
| run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.3-test --format '{{.ID}}')"" | ||
| echo 'output:' $output | ||
| [[ "$output" == *"(8.3-test)"* ]] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.bats |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| FROM alpine:3.21 | ||
|
|
||
| LABEL maintainer="developers@graze.com" \ | ||
| license="MIT" \ | ||
| org.label-schema.schema-version="1.0" \ | ||
| org.label-schema.vendor="graze" \ | ||
| org.label-schema.name="php-alpine" \ | ||
| org.label-schema.description="small php image based on alpine" \ | ||
| org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" | ||
|
|
||
| # Fix for iconv: https://github.com/docker-library/php/issues/240 | ||
| RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted | ||
|
|
||
|
rick-lam marked this conversation as resolved.
Outdated
|
||
| RUN set -xe \ | ||
| && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.21/community" >> /etc/apk/repositories \ | ||
| && apk add --update --no-cache \ | ||
| ca-certificates \ | ||
| curl \ | ||
| gnu-libiconv \ | ||
| openssh-client \ | ||
| libmemcached-libs \ | ||
| libevent \ | ||
| libssl3 \ | ||
| musl \ | ||
| yaml \ | ||
| php84 \ | ||
| php84-pecl-apcu \ | ||
| php84-pecl-event \ | ||
| php84-pecl-memcached \ | ||
| php84-pecl-yaml \ | ||
| php84-bcmath \ | ||
| php84-common \ | ||
| php84-ctype \ | ||
| php84-curl \ | ||
| php84-dom \ | ||
| php84-fileinfo \ | ||
| php84-iconv \ | ||
| php84-intl \ | ||
| php84-openssl \ | ||
| php84-opcache \ | ||
| php84-mbstring \ | ||
| php84-mysqlnd \ | ||
| php84-mysqli \ | ||
| php84-pcntl \ | ||
| php84-pgsql \ | ||
| php84-pdo_mysql \ | ||
| php84-pdo_pgsql \ | ||
| php84-pdo_sqlite \ | ||
| php84-phar \ | ||
| php84-posix \ | ||
| php84-simplexml \ | ||
| php84-session \ | ||
| php84-soap \ | ||
| php84-sockets \ | ||
| php84-sodium \ | ||
| php84-tokenizer \ | ||
| php84-xml \ | ||
| php84-xmlreader \ | ||
| php84-xmlwriter \ | ||
| php84-zip \ | ||
| php84-zlib | ||
|
|
||
| ENV PHP_INI_DIR /etc/php84 | ||
|
|
||
| RUN ln -s /usr/bin/php84 /usr/bin/php | ||
| RUN ln -s /usr/bin/pecl84 /usr/bin/pecl | ||
|
|
||
| COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/ | ||
|
|
||
| WORKDIR /srv | ||
|
|
||
| ARG BUILD_DATE | ||
| ARG VCS_REF | ||
|
|
||
| LABEL org.label-schema.vcs-ref=$VCS_REF \ | ||
| org.label-schema.build-date=$BUILD_DATE | ||
|
|
||
| # Fix for iconv: https://github.com/docker-library/php/issues/240 | ||
| ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| FROM graze/php-alpine:8.4 | ||
|
|
||
| RUN apk add --update --no-cache \ | ||
| php84-phpdbg | ||
|
|
||
| ARG BUILD_DATE | ||
| ARG VCS_REF | ||
|
|
||
| LABEL org.label-schema.vcs-ref=$VCS_REF \ | ||
| org.label-schema.build-date=$BUILD_DATE |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.